A while loop runs as long as its condition is true:
let count = 0
while (count < 5) {
console.log(count)
count++
}
// Prints: 0, 1, 2, 3, 4
The condition is checked before each iteration. If it starts false, the loop body never runs. Always ensure something inside the loop eventually makes the condition false.