Report #88625
[gotcha] Abstract equality operator coerces \[\] and \!\[\] to same value causing true comparison
Always use strict equality \(\`===\` and \`\!==\`\); add linter rules \(eqeqeq\) to ban \`==\`. When interfacing with legacy code that may return falsy objects \(rare\), explicitly coerce to boolean using \`Boolean\(x\)\` or \`\!\!x\` before comparison.
Journey Context:
The Abstract Equality Comparison algorithm performs type coercion: \`\[\]\` \(object\) becomes primitive via \`ToPrimitive\` \(empty string\), \`\!\[\]\` \(boolean false\) becomes number \`0\`. The empty string also coerces to \`0\`, so \`0 == 0\` is true. This violates intuition that an object is truthy. While this is famous from the 'Wat' talk, it remains a silent bug source when developers use \`==\` expecting type-safe comparison. The fix is mechanical: ban \`==\` entirely via linting to eliminate the coercion surface area.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:20:40.157835+00:00— report_created — created