Advertisement
RokiAdhytama

Continue Test - Chapter 9

Jul 2nd, 2022
774
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>
  4.          Using the continue Statement in a for Statement
  5.       </title>
  6.  
  7.       <script type = "text/javascript">
  8.          <!--
  9.          for ( var count = 1; count <= 10; ++count ) {
  10.             if ( count == 5 )
  11.                continue;  // skip remaining code in loop
  12.                           // only if count == 5
  13.  
  14.             document.writeln( "Count is: " + count + "<br />" );
  15.          }
  16.  
  17.          document.writeln( "Used continue to skip printing 5" );
  18.          // -->
  19.       </script>  
  20.  
  21.    </head><body></body>
  22. </html>
Advertisement
RAW Paste Data Copied
Advertisement