Report #102464
[gotcha] == and === behave differently around type coercion, null/undefined, and object-to-primitive conversion
Use === and \!== for almost every comparison; use == only when you explicitly want type coercion, such as checking null and undefined together with value == null.
Journey Context:
== applies the Abstract Equality Comparison algorithm: it coerces operands to compatible types, so 0 == '0', '' == false, and null == undefined are true. === is strict and returns false when types differ. Surprising cases like \[\] == \!\[\] being true come from ToPrimitive and Boolean coercion. Strict equality is predictable and faster; the only common acceptable use of == is value == null to cover both null and undefined.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:55:08.405873+00:00— report_created — created