This section provides a quick description of the 'switch ... case' statement.
"switch case" statements are alternative ways of executing statements selectively based on certain conditions.
A "switch case" statement has the following generic syntax format:
where "test_expression" is used to generate a test value that will be tested against with expected values specified
in "case" clauses. The execution of a "switch case" statement goes like this:
"case" clauses are possible execution starting points.
Each "case" clause will be visited sequentially from top to bottom.
If the expected value of a "case" clause equals to the test value resulted form the switch expression,
the execution starts from those statements listed in this "case" clause.
Once the execution started, it will continue until a break statement is reached
or the end of the "switch" block is reached.
The "default" clause is optional. But if it is provided, it will become the execution starting point
when all case tests before the "default" clause are failed.
Unlike many other programming languages, JavaScript supports both numeric expression and string expression
as the switch test expression.
A tutorial example will be given in the next section showing examples of "switch ... case" statements.