EN
JavaScript - continue statement
0 points
In this article, we would like to show you how to use continue statement in JavaScript.
Quick solution:
xxxxxxxxxx
1
for (let i = 0; i < 5; i++) {
2
if (i === 3) {
3
continue;
4
}
5
console.log(i);
6
}
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.