JS continue

Last Updated: March 16, 2022

In JavaScript code, you can skip the current iteration and start the next iteration.

continue can be used for while, do-while, and for each loop

const numbers = [1, 2, 3, 4, 5];
let i =0;

while(i< array.length) {
    if(i==3){
       continue;
    }
    console.log(numbers[i]);
});
Test