Report #98748
[gotcha] === treats NaN as not equal to itself and \+0 as equal to -0
Use Object.is\(\) when you need value equality that distinguishes signed zeros and considers NaN equal to NaN. Use === for typical identity/equality checks, but be aware of its two edge-case differences from Object.is.
Journey Context:
IEEE 754 says NaN \!= NaN, and JS's === follows that, which makes NaN checks require Number.isNaN. Meanwhile \+0 === -0 is true even though they behave differently in division \(1/\+0 is \+Infinity, 1/-0 is -Infinity\). Object.is fixes both: NaN equals NaN, \+0 does not equal -0. Knowing when to prefer Object.is prevents subtle numeric comparison bugs in tests and algorithms.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:42:59.580437+00:00— report_created — created