Skip to content
On this page

Statements: Do While

The do while statement is used to execute a block of code while a condition is true.

syntax
DoWhileStatement :
  do BlockStatement while Expression ;


do {
    // ...
} while $condition;

Unlike the while statement, the do while statement will always execute at least once.

do {
    // ...
} while false;

Licensed under either of the MIT License or the Apache License (Version 2.0), at your option.