JavaScript/Reserved words/switch

The switch keyword
The switch keyword is a control structure that evaluates the expression and compares it with the values in the case clauses. If none match, the default clause is executed.

If there is no break after the end of a case clause or a return, execution continues; otherwise, the switch block is left. It is good programming practice to comment a deliberate "falling through".

Examples

 * Example 1


 * Example 2