➕strict equality (===)
equality without type conversion.
JS ⟩ statement ⟩ expression ⟩ operator ⟩ relational ⟩ strict (===)
compares two values, without type conversion.
🈯 synonyms: ”identity operator"
👉 compare: sloppy equality (==)
<= and >= do not rely on == or ===❗
replit: strict equality (===)
// (different types)
null === undefined, // false
0 === '0', // false
0 === false, // false
1 === true, // false
'1' === true, // false
'0' === false, // false
// (same type, different instannces)
Symbol() === Symbol(), // false (different symbols)
{a: 1} === {a: 1}, // false (different objects)
// ⭐️ computer math is not perfect!
0.1 + 0.2, // 0.30000000000000004
0.1 + 0.2 === 0.3, // false❗ Last updated
Was this helpful?