JavaScript continue Statement
The continue statement skips the rest of the current loop iteration and moves on to the next one.
Description
The continue statement ends the current iteration of a loop and continues with the next one. In a for loop the update expression still runs. It's often used to skip items that don't need processing, keeping the main code less indented.
Using continue early in a loop body for cases you want to skip keeps the rest of the code at a single level of indentation, which many people find easier to read than wrapping it all in an if. It works in for, for...of, for...in, while and do...while loops, but not inside a forEach() callback, where return does the same job of moving on to the next element.
With a label, continue outer skips to the next iteration of an outer loop from inside a nested one. In a while loop, make sure the code that moves towards the end condition runs before the continue, or the loop may never finish.
Syntax
continue;
continue label;Example
Browser Support
The following information will show you the current browser support for the continue statement. Hover over a browser icon to see the version that first introduced support for this statement.
Desktop





Tablets & Mobile





