JavaScript » Statements » do...while

Syntax:
do statements while (condition);

The do...while statement executes one or more statements at least once, checking that a certain condition is met each time before repeating. If that condition is not met, then control moves to the statement immediately after the loop.

Examples

Code:
var i = 0;
do
{
   document.write(i + ".<BR>");
   i+=2;
}
while(i<20);
Explanation:

This example counts up in twos for as long as the number is less than 20.