Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns = "http://www.w3.org/1999/xhtml">
- <head>
- <title>
- Using the break Statement in a for Statement
- </title>
- <script type = "text/javascript">
- <!--
- for ( var count = 1; count <= 10; ++count ) {
- if ( count == 5 )
- break; // break loop only if count == 5
- document.writeln( "Count is: " + count + "<br />" );
- }
- document.writeln(
- "Broke out of loop at count = " + count );
- // -->
- </script>
- </head><body></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement