while Loop

noun

say it: “WILE loop” /waɪl luːp/

A loop that keeps running its block as long as its condition stays true, checking the condition before each pass.

What is while Loop in JavaScript?

while Loop — Keeps repeating as long as its condition stays true.

let attempts = 0;

while (attempts < 3) {
    attempts++;
}

In a sentence

  • “The while loop keeps rolling the dice until it lands on 6.”

Level: Apprentice · More JavaScript terms at this level

Updated

In other subjects