Report #101996
[gotcha] Loose equality \(==\) produces surprising true results like null == undefined and \[\] == false
Use strict equality \(=== and \!==\) everywhere. If you need to accept both null and undefined, use value === null \|\| value === undefined, or value == null as a deliberate, commented exception.
Journey Context:
== coerces types through the Abstract Equality Comparison algorithm: null and undefined are equal to each other and nothing else, \[\] coerces to 0, '' coerces to false, and '0' == 0 is true. These rules are not intuitive and create landmines in conditionals and tests. TypeScript's type system does not catch == bugs. The only common legitimate use of == is value == null to mean 'null or undefined', which is shorter and behaves identically to the explicit check; everything else should be ===.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:47:47.052902+00:00— report_created — created