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

JS Arrays

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

Arrays များသည် items အများအပြားကို variable တစ်ခုတည်းမှာ သိမ်းဆည်းရန်သုံးသည်။ Array methods များ (push, pop, forEach, map) ဖြင့် data များကို လွယ်ကူစွာစီမံနိုင်သည်။

javascript
const fruits = ["Banana", "Orange", "Apple"];

// Add a new item to the end
fruits.push("Mango");

// Loop through the array
fruits.forEach(function(fruit) {
  console.log("I like " + fruit);
});
You should see
I like Banana I like Orange I like Apple I like Mango
JS Arrays | Thuta Learning