JavaScript Break and Continue

JavaScript Break and Continue


JavaScript Break and Continue
 
Break Statement
The break statement terminates the loop immediately when it is encountered, Simply comes out of the loop. Immediately after the closing brace of the loop will be executed.
The Syntax of the Break statement is as follows:
                   break;
 
Example
Output
Continue Statement: The continue statement skips some statement inside the loop. Loop will be restarted when a continuation is encountered.
The Syntax of the continue statement is as follows:
                    continue;
 
Example
Output