The continue keyword is a jump statement. It is used in an iterator loop to proceed to the next cycle without executing the remaining lines in the statement block.
A continue statement can only legally exist inside a while or for loop in an ECMA-compliant implementation. Implementations that provide additional iterator types may also honor the same behavior for the continue statement.
The continue statement is obeyed by the smallest enclosing iterator loop.
A labeled continue behaves differently according to the iterator it has been used in.
In Netscape 4, there is a bug with labeled continue statements and do ... while loops that causes the continue to vector to the top of the loop without testing the condition. This can set up an endless loop. You could work round this by creating a while loop and modifying the test condition.
When the continue statement is used, its behavior inside a while loop suggests that a while loop is not exactly similar to a for loop. In a while loop, it simply runs the test condition again before deciding to loop or not. In a for loop, the incrementor gets executed again and then the test condition. You cannot perfectly simulate a for loop with a while loop if a continue statement is involved.
ECMA 262 edition 2 - section - 10.1.4
ECMA 262 edition 2 - section - 12.7
ECMA 262 edition 3 - section - 10.1.4
ECMA 262 edition 3 - section - 12.7