Switch Structure
The switch statement syntax.
Switch Structure
The switch statement is used to perform different actions based on different conditions.
Use the switch statement to select one of many code blocks to be executed.
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}