JS operators များသည် တန်ဖိုးများပေါ်တွင် တွက်ချက်မှုများပြုလုပ်ရန် သုံးသည်။
• Arithmetic: +, -, *, /, % (modulus)
• Assignment: =, +=
• Comparison: == (equal value), === (equal value and type), !=, !==, >, <
• Logical: && (and), || (or), ! (not)
=== (Strict Equality) ကိုသုံးခြင်းက type coercion ကြောင့်ဖြစ်သော bug များကိုရှောင်ရှားနိုင်သဖြင့် အကောင်းဆုံးဖြစ်သည်။
javascript
let x = 5 + 5;
let y = "5" + 5; // "55" (concatenation)
let z = 5 == "5"; // true (loose equality)
let a = 5 === "5"; // false (strict equality)
console.log(z);
console.log(a);You should see
true false