Let i = 0;
do {
alert( i );
i++;
} while (i < 3);
The condition check can be moved below the loop body using the do..while syntax.
The loop will first execute the body, then check the condition and, while it's truthy, execute it again and again.
Syntax
Do {
// loop body
} while (condition);