JavaScript Break and Continue Statements
The break statement will break the loop and continue executing the code that follows after the loop (if any). The break Statement Example <html>
The continue Statement<body> <script type="text/javascript"> var i=0; for (i=0;i<=10;i++) { if (i==3) { break; } document.write("The number is " + i); document.write("<br />"); } </script> </body> </html> The continue statement will break the current loop and continue with the next value. Example <html>
<body> <script type="text/javascript"> var i=0 for (i=0;i<=10;i++) { if (i==3) { continue; } document.write("The number is " + i); document.write("<br />"); } </script> </body> </html> |
|||

