- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript continue Statement
JavaScript Loops
JavaScript continue Statement
The JavaScript
continuestatement is used to skip one turn of a loop and move on to the next one.
When JavaScript finds a continue statement inside a loop, it stops the current turn and jumps straight to the next one.
The loop itself keeps running. Only the remaining code in that one turn is skipped.
Example
Example
javascript
for (let i = 1; i <= 5; i++) {
if (i === 3) {
continue;
}
console.log(i);
}In this example, the number 3 is skipped.
