Thuta Learning
ရှာဖွေရန်
BasicProgrammingbeginner

JS While Loop

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

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
JS While Loop | Thuta Learning