Report #29283
[gotcha] Strict equality === requires two checks to detect both null and undefined while loose equality == has a safe idiomatic exception
Use == null to check for both null and undefined in a single expression; use === for all other comparisons including checking for false, 0, or empty string
Journey Context:
The only safe use of loose equality in modern JavaScript is == null, which matches both null and undefined but nothing else \(unlike == undefined which can be overridden or == false which matches 0 and ''\). Using === requires \(x === null \|\| x === undefined\). Linters like ESLint specifically allow == null while forbidding other == usages. This pattern is essential for defensive null-checking in TypeScript strict mode where undefined and null are distinct.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:32:42.677507+00:00— report_created — created