The do..while Statement Ensures at Least One Iteration : While « Language Basics « JavaScript DHTML






The do..while Statement Ensures at Least One Iteration

  
<html>
<head>
  <title>The do..while Statement Ensures at Least One Iteration</title>
</head>
<body>
<script language="JavaScript1.2" type="text/javascript">
  <!--
    var userEntry = 0;
    var x = 1;
   
    do{
      document.writeln(x);
      x++;
    }while(x <= userEntry);
  // -->
  </script>
</body>
</html>


           
         
    
  








Related examples in the same category

1. A While Loop That Decrements from 10 to 1
2.Using a Do/While Loop to Reverse a Text String
3.While loop
4.Do while loop
5.Using the while Loop in JavaScript
6.The while Statement
7.Loop in while
8.While loop test
9.Check the loop counter for while loop
10.Do ... while loop and output calculation result