"do..while"

"do..while"

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);

Related concepts

"do..while"

"do..while" — Structure map

Clickable & Draggable!

"do..while" — Related pages: