JavaScript语言参考手册 |
JavaScript手册
|
【目录】 【上一页】 【下一页】 【索引】
switchAllows a program to evaluate an expression and attempt to match the expression's value to a case label.
The program first looks for a label matching the value of expression and then executes the associated statement. If no matching label is found, the program looks for the optional default statement, and if found, executes the associated statement. If no default statement is found, the program continues execution at the statement following the end of switch. The optional break statement associated with each case label ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch. If break is omitted, the program continues execution at the next statement in the switch statement.
【目录】 【上一页】 【下一页】 【索引】 |