EN
JavaScript - continue statement
0
points
In this article, we would like to show you how to use continue statement in JavaScript.
Quick solution:
// ONLINE-RUNNER:browser;
for (let i = 0; i < 5; i++) {
if (i === 3) {
continue;
}
console.log(i);
}
The continue
statement is used to skip the current iteration of the loop if the specified condition occurs. In this case the loop breaks when our counter (i
) reaches the value of 3
and continues with the next iteration.