while

while is a loop that executes when the condition is true.

It is similar to a for loop but has different syntax.

Syntax

Δ

while (condition) {
  code
}

Example

Δ

Reference

Δ