do while

The do while loop is a variant of the while loop. This block is first executed and then repeated as long as the condition is true.

Syntax

          do {
  // statements
}
while (condition) 

        

Example

          var i=0;
do {
    x = x + "The number is " + i;
    i++;
}
while ( i < 5 )