Advertisement
RokiAdhytama

Break Label Test - Chapter 9

Jul 2nd, 2022
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html xmlns = "http://www.w3.org/1999/xhtml">
  2.    <head>
  3.       <title>Using the break Statement with a Label</title>
  4.  
  5.       <script type = "text/javascript">
  6.          <!--
  7.          stop: {   // labeled block
  8.             for ( var row = 1; row <= 10; ++row ) {
  9.                for ( var column = 1; column <= 5 ; ++column ) {
  10.  
  11.                   if ( row == 5 )
  12.                      break stop; // jump to end of stop block
  13.  
  14.                   document.write( "* " );
  15.                }
  16.  
  17.                document.writeln( "<br />" );
  18.             }
  19.  
  20.             // the following line is skipped
  21.             document.writeln( "This line should not print" );
  22.          }
  23.  
  24.          document.writeln( "End of script" );
  25.          // -->
  26.       </script>
  27.  
  28.    </head><body></body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement