ဂျပန်ဆိုင်ရာ ပေါင်းစပ်ကုသ
- ပြီးလျှင် ဗဟိုအား ပြောင်းလဲ
- နောက်လိုက် ဂျက်တို့ ဗဟိုအား
အစုအဖွဲ့ အချက်အလက် အမှုအတွင်း
အစုအဖွဲ့ အချက်အလက် အသုံးပြု အမှုအတွင်း
let {firstName, lastName} = person;
အစုအဖွဲ့ နှင့် အခြား အသုံးပြု နိုင်သည်။
let [firstName, lastName] = person;
အစုအဖွဲ့ အသုံးပြု
အမှတ်အသား
// အစုအဖွဲ့ ဖန်တီး const person = { firstName: "Bill", lastName: "Gates", age: 50 }; // လုပ်ငန်း let {firstName, lastName} = person;
အခြေအနေ အမှာ အရေးပါသေး
အမှတ်အသား
// အစုအဖွဲ့ ဖန်တီး const person = { firstName: "Bill", lastName: "Gates", age: 50 }; // လုပ်ငန်း let {lastName, firstName} = person;
အချက်ပြချက်
အစုအဖွဲ့ အသုံးပြု အရာမရှိ
အစုအဖွဲ့ အသုံးပြု အရာမရှိ
အစုအဖွဲ့ အချက်အလက်
အချိန် မရှိသော အခြေအနေ အတွက် အချက်အလက် ကို ဖြည့်စွက် နိုင်သည်။
အမှတ်အသား
// အစုအဖွဲ့ ဖန်တီး const person = { firstName: "Bill", lastName: "Gates", age: 50 }; // လုပ်ငန်း let {firstName, lastName, country = "US"} = person;
အစုအဖွဲ့ အသုံးပြု အမည်
အမှတ်အသား
// အစုအဖွဲ့ ဖန်တီး const person = { firstName: "Bill", lastName: "Gates", age: 50 }; // လုပ်ငန်း let {lastName: name} = person;
အစုအဖွဲ့ အဆိုပါ
အစုအဖွဲ့ အသုံးပြု နိုင်သည်။
အမှတ်အသား
// အစုအဖွဲ့ ဖန်တီး let name = "W3Schools"; // လုပ်ငန်း let [a1, a2, a3, a4, a5] = name;
အချက်ပြချက်
အစုအဖွဲ့ အသုံးပြု နိုင်သည်။
အစုအဖွဲ့ အဆိုပါ
အစုအဖွဲ့ အသုံးပြု နိုင်သည်။
အမှတ်အသား
// ပြုလုပ် အတ္ထုပတ် const fruits = ["Bananas", "Oranges", "Apples", "Mangos"]; // လုပ်ငန်း let [fruit1, fruit2] = fruits;
အချိန် ကျန်ရှိ
နောက်ဆုံး အသုံးပြု နိုင်သည်။
အမှတ်အသား
// ပြုလုပ် အတ္ထုပတ် const fruits = ["Bananas", "Oranges", "Apples", "Mangos"]; // လုပ်ငန်း let [fruit1,,,fruit2] = fruits;
အစုအဖွဲ့ အချိန်
ကျန်ရှိသော အသုံးပြု နိုင်သည်။
အမှတ်အသား
// ပြုလုပ် အတ္ထုပတ် const fruits = ["Bananas", "Oranges", "Apples", "Mangos"]; // လုပ်ငန်း let {[0]: fruit1, [1]: fruit2} = fruits;
ကျန်ရှိသော အခြေအနေ
အပိုင်းပေါ် အဆိုပါ အသုံးပြု နိုင်သည်။
ဒီ လုပ်ငန်း ဖြင့် အရာခံ အတ္ထုပတ် အား အချက်အလက် အသစ် အတွင်း ကို ကိုင်တွယ်နိုင်ပါသည်:}}
အမှတ်အသား
// ပြုလုပ် အတ္ထုပတ် const numbers = [10, 20, 30, 40, 50, 60, 70]; // လုပ်ငန်း const [a, b, ...rest] = numbers;
ပလပိုလ် လုပ်ငန်း
အမှတ်အသား
// ပြုလုပ် ပလပိုလ် const fruits = new Map([ ["apples", 500], ["bananas", 300], ["oranges", 200] }); // လုပ်ငန်း let text = ""; for (const [key, value] of fruits) { text += key + " is " + value; }
ဂျက်တို့ အခြေအနေ ပြောင်းလဲ
အသုံးပြုနိုင်သော လုပ်ငန်း ဖြင့် နှစ်ခုမျှ အခြေအနေ ကို ပြောင်းလဲနိုင်ပါသည်:
အမှတ်အသား
let firstName = "Bill"; let lastName = "Gates"; // လုပ်ငန်း [firstName, lastName] = [lastName, firstName];
- ပြီးလျှင် ဗဟိုအား ပြောင်းလဲ
- နောက်လိုက် ဂျက်တို့ ဗဟိုအား