Core JavaScript 1.5 Guide:Loop Statements:do...while Statement
From MDC
[edit] do...while Statement
The do...while statement repeats until a specified condition evaluates to false. A do...while statement looks as follows:
do statement while (condition);
statement executes once before the condition is checked. To execute multiple statements, use a block statement ({ ... }) to group those statements. If condition is true, the statement executes again. At the end of every execution, the condition is checked. When the condition is false, execution stops and control passes to the statement following do...while.
Example
In the following example, the do loop iterates at least once and reiterates until i is no longer less than 5.
do {
i += 1;
document.write(i);
} while (i < 5);