Prev Demo
JavaScript
>
How To Skip The Current Iteration Of The Loop And Continue With The Next Iteration In Javascript?
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Continue Loop</h1> <script> function TestFunction() { var i = 0; do { i++; if (i == 2) { continue; } alert(i); } while (i < 5); } </script> <input type="button" id="btnTest" onclick="TestFunction()" value="Click me" /> </body> </html>
Note: We DO NOT save your trial code in our database.
Output