Code demonstration of continue in JavaScript loop

From , 3 Years ago, written in JavaScript, viewed 53 times.
URL https://pastebin.vip/view/bc1ad6e8
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p>Click the button to do a loop which will skip the step where i=3.</p>
  6. <button onclick="myFunction()">Try it</button>
  7. <p id="demo"></p>
  8.  
  9. <script>
  10. function myFunction()
  11. {
  12. var x="",i=0;
  13. for (i=0;i<10;i++)
  14.   {
  15.   if (i==3)
  16.     {
  17.     continue;
  18.     }
  19.   x=x + "The number is " + i + "<br>";
  20.   }
  21. document.getElementById("demo").innerHTML=x;
  22. }
  23. </script>
  24.  
  25. </body>
  26. </html>
  27.  
  28.  
  29.  
  30. //javascript/7840

Reply to "Code demonstration of continue in JavaScript loop"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website