Report #70389
[gotcha] == and === diverge in more ways than just type coercion, especially around null, undefined, NaN, and signed zero
Default to === everywhere; use x == null only as a deliberate shorthand for x === null \|\| x === undefined; use Object.is when you need NaN to equal NaN or to distinguish \+0 from -0.
Journey Context:
Loose equality coerces operands before comparing, so '' == 0, '1' == 1, \[\] == false, and null == undefined are true. Strict equality never coerces. The only widely accepted use of == is null/undefined because those two are loosely equal only to each other. Object.is differs from === in exactly two places: NaN equals NaN, and \+0 and -0 are distinct. This matters because Array.indexOf uses strict equality, so \[NaN\].indexOf\(NaN\) is -1, while Map and Set use SameValueZero where NaN matches and \+0/-0 are treated as equal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:44:05.420996+00:00— report_created — created