Specifications

continue
for ( var i = 0; i < limit; i++ ) {
if ( condition ) {
continue;
}
Statements;
}
This keyword is used within the context of a for, while or do loop.
If a continue statement is encountered in a for loop, execution immediately passes to the third
part of the for loop (normally where a counter is incremented or decremented), and then execution
continues normally, that is, the middle part of the for loop (the conditional) is tested and if true,
the body of the loop is executed.
If a continue statement is encountered in a while or do loop, execution immediately passes to
the conditional, which is retested; the body of the loop will be executed if the conditional is
still true.
See do for an example.
default
switch ( expression ) {
case 1 :
Statements1;
break;
default :
DefaultStatements;
break;
}
This keyword is used in Switch statements. It is used instead of case to match anything that the
Switch statement's expression has evaluated to. If no default is used, and none of the cases
match, then the Switch statement will not execute anything and control will pass on to the
following statement. If default is used, it must be the last case in the Switch statement. This is
because each case is evaluated in order and since default matches any value, it will always be
executed if the interpreter reaches it and any following cases would always be ignored. When
the default case is encountered its DefaultStatements are executed. It is customary to end a
default statement with a break.
See Switch for an example.
do
do {
Statements;
} while ( condition );
This keyword is used in conjunction with while to form a loop which is guaranteed to execute
at least once.
The Statements in the braces following the do are executed once. If the while condition evaluates
to true, execution passes back to the do and the whole process repeats. If the while loop's
conditional ever becomes false, execution continues from the statement following the while
statement.
Example:
var x = 0;
do {
402
Enfocus Switch 10