Languages
[Edit]
EN

JavaScript - continue statement

0 points
Created by:
Jan-Alfaro
311

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.

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join