Do it again… and again
Making kheer, you keep stirring while the milk is thin. You don't write "stir" a hundred times in the recipe — you write the rule once. A loop lets code repeat the same way.
The while loop
A while loop repeats its block as long as the condition is true. Each time through is called an iteration.
let count = 1;
while (count <= 3) {
console.log("Stir " + count);
count = count + 1;
}
console.log("Kheer is ready!");