Report #104673
[gotcha] Using the loose equality operator \(==\) triggers type coercion that leads to surprising results, e.g., '' == false, \[\] == false, null == undefined, '0' == false, but also '' == 0, and \[1\] == 1.
Always use strict equality \(===\) unless you have a specific reason to use == and fully understand the coercion rules. For null/undefined checks, use x == null to catch both, but document it.
Journey Context:
The abstract equality algorithm \(ECMA-262 7.2.13\) has many steps. Common pitfalls: comparing to false coerces to 0, empty array to 0, etc. Using === avoids all these. The only acceptable use of == is x == null \(which checks both null and undefined\). Many linting rules enforce ===.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-27T20:05:38.138465+00:00— report_created — created