while loop ကို သတ်မှတ်ထားသော condition တစ်ခု မှန်နေသရွေ့ code block တစ်ခုကို ထပ်ခါထပ်ခါ run ရန်သုံးသည်။
javascript
let i = 0;
let text = "";
while (i < 5) {
text += "The number is " + i + "\n";
i++;
}
console.log(text);You should see
The number is 0 The number is 1 The number is 2 The number is 3 The number is 4