do...while





js/script.js
  • function funMake() {
  •  var val = 0;
  •  var i = 0;
  •  
  •  do {
  •   i++;
  •   document.write('Hello World!');
  •  } while(val!=0);
  • }
function funMake() {
 var val = 0;
 var i = 0;

 do {
  i++;
  document.write('Hello World!');
 } while(val!=0);
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <script src="js/script.js"></script>
  • </head>
  • <body>
  • <script>
  •  funMake();
  • </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <script src="js/script.js"></script>
  • </head>
  • <body>
  • <script>
  •  funMake();
  • </script>
  • </body>
  • </html>