JS.10.6 The 'switch' Statement

A 'switch' statement evaluates an expression and matches its result with a list of choices. If a match is found, the statements under the choice are executed. Otherwise, if a 'default' label exists, the statements in the default block are executed.

switch(expression) {

case label:

  statements;

  break;

case label:

  statements;

  break;

  ...

default:

  statements;

}

See Also

Appendix JS.10.3, The 'if' Statement, to conveniently test a small set of conditions.

<< JS.10.5 Iteration Statements © 1996-2013 InetSoft Technology Corporation (v11.4) JS.10.7 The 'with' Statement >>