Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
⊗jsOpBsOC 24 of 60 menu

JavaScript တွင် OOP အရာဝတ္ထုများကို နှိုင်းယှဉ်ခြင်း

အရာဝတ္ထုများကို သိမ်းဆည်းထားသည့် ကိန်းရှင်များကို နှိုင်းယှဉ်ပုံကို ကြည့်ရအောင်။ ကိန်းရှင်နှစ်ခုသည် တူညီသည်ဟု ယူဆပါမည်၊ အကယ်၍ ၎င်းတို့တွင် တူညီသောအရာဝတ္ထုတစ်ခုသို့ ညွှန်ပြသည့် လိပ်စာတစ်ခုပါရှိပါက။ လက်တွေ့တွင် ကြည့်ကြရအောင်။ အောက်ပါ class ရှိသည်ဟု ယူဆပါစို့။

class User { constructor(name) { this.name = name; } }

ဤ class ၏ အရာဝတ္ထုနှစ်ခုကို ဖန်တီးကြမည်။

let user1 = new User('1'); let user2 = new User('2');

တူညီသောအရာဝတ္ထုတစ်ခုသို့ ညွှန်ပြသည့် လိပ်စာပါရှိသော ကိန်းရှင်များကို နှိုင်းယှဉ်ကြည့်ကြမည်။

console.log(user1 === user1); // true

ယခု ကွဲပြားသောအရာဝတ္ထုများသို့ ညွှန်ပြသည့် လိပ်စာပါရှိသော ကိန်းရှင်များကို နှိုင်းယှဉ်ကြည့်ကြမည်။

console.log(user1 === user2); // false

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် အဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = new Employee('eric'); console.log(emp1 === emp2);

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် �ဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = new Employee('eric'); console.log(emp1 === emp1);

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် အဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = new Employee('john'); console.log(emp1 === emp2);

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် အဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = new Employee('eric'); console.log(emp1 !== emp1);

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် အဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = emp1; console.log(emp1 === emp2);

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် အဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = new Employee('eric'); console.log(emp1 !== emp2);

အောက်ပါကုဒ်တွင် နှိုင်းယှဉ်မှု၏ရလဒ်သည် အဘယ်နည်းဟု ပြောပြပါ။

class Employee { constructor(name) { this.name = name; } } let emp1 = new Employee('john'); let emp2 = emp1; emp2.name = 'eric'; console.log(emp1 === emp2);
မြန်မာ
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEnglishEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
ဝက်ဘ်ဆိုက် လုပ်ဆောင်ခြင်း၊ ဆန်းစစ်လေ့လာခြင်းနှင့် ပုဂ္ဂလိကပြုပြင်ခြင်းအတွက် ကျွန်ုပ်တို့သည် cookie များကို အသုံးပြုပါသည်။ ဒေတာများကို ပြုပြင်ခြင်းသည် ကိုယ်ရေးကိုယ်တာ မူဝါဒအတိုင်း ဖြစ်ပါသည်။
အားလုံးလက်ခံရန် ပြင်ဆင်ရန် ငြင်းပယ်ရန်