switch(expression) {
case constant-expression1: {
//statements;
break;
}
case constant_expression2: {
//statements;
break;
}
default: {
//statements;
break;
}
}
let x = 10, y = 5;
switch (x-y) {
case 0:
console.log("Result: 0");
break;
case 5:
console.log("Result: 5");
break;
case 10:
console.log("Result: 10");
break;
}