while

With a while loop you can execute code repeatably as long as a certain condition is fulfilled. It is written with the while keyword followed by a condition wrapped in round brackets and a code block that contains the body of the loop wrapped in curly brackets.

while (condition) {
  // code that is executed repeatedly as long as the condition is true
}

References