Do While - Loop in JavaScript

Do While is modified version of While Loop and only difference being, the code will be executed at least once before checking the condition then it repeats the loop as long as the condition is true.

<script type='text/javascript'>
    var light = "red";             
    var counter = 1;               
      do
      {
          document.write(counter + "<BR>");
          counter++;
      }
      while (counter < 5);
</SCRIPT>