A continue statement terminates the execution of a block of statements in a while or for loop and continues execution of the loop at the next iteration. The continue statement does not terminate the execution of the loop:
In a while loop, it returns to the condition
In a for loop, it jumps to the update expression
NOTE Using a continue statement outside of a while or a for loop generates an error.
The following is an example of a continue statement:
var index = 0;
var count = 0;
while (index < 5) {
index++;
if (index == 3) continue;
count += index;
}