In this post, we are going to explain the JavaScript break statement example If you want to learn the javascript, then keep your close attention in this post. This post helps you to understand break statement.
Related Posts: Switch statement in JavaScript with the example
Copy the below break statement example and create a JS file to execute this code snippet.
1 2 3 4 5 6 7 8 9 10 11 12 |
<SCRIPT type="text/javascript"> var count=0; while(count<10) { ++count; if((count%5==0)) break; else document.write("count="+count+"<BR/>"); } document.write("The while loop exited."); </SCRIPT> |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: javascript break function, javascript break if, javascript break statement, javascript illegal break statement, javascript tutorial, javascript tutorials