Report #97290
[gotcha] null >= 0 is true, null > 0 is false, and null == 0 is false, breaking trichotomy
Always compare numbers with numbers. Explicitly coerce nullable numeric values with Number\(x\) ?? 0 before relational comparisons, or check for null/undefined separately.
Journey Context:
Relational operators use ToNumber, which converts null to 0, but loose equality has a special case that makes null equal only to undefined. This creates an inconsistent trichotomy that surprises even experienced developers. The safest fix is to avoid relying on implicit coercion and to make null handling explicit at the edge of a function.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:51:56.168280+00:00— report_created — created