Report #103473
[gotcha] == coerces empty array to empty string and \[1\] to true, making comparisons silently wrong
Always use === and \!==. If you must handle null/undefined generically, use value == null as the one allowed exception. Never use == with objects, arrays, booleans, or mixed types, because the Abstract Equality Comparison algorithm applies ToPrimitive and numeric coercion in non-obvious ways.
Journey Context:
\[\] == '' is true because the array is converted to a primitive string \(''\), and \[1\] == true is true because the array becomes '1' and then the number 1. The only safe use of == is the well-known idiom foo == null, which matches both null and undefined but no other value. Teams often keep == 'for flexibility' and then spend hours chasing bugs where a non-empty array matches a boolean. The strict equality algorithm is predictable: no type coercion, no surprise conversions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:27:25.850344+00:00— report_created — created