Report #9137
[gotcha] document.all is falsy but loosely equals null and undefined, breaking truthiness checks
Always use strict equality \(===\) when checking for document.all or presence of DOM objects; treat it as a boolean false in loose contexts
Journey Context:
document.all is an HTMLAllCollection that is falsy \(Boolean\(document.all\) === false\) for historical web compat \(browser detection\). Uniquely, document.all == null and document.all == undefined both return true, despite document.all \!== null. This breaks the common pattern if \(obj == null\) which normally catches both null and undefined. This only affects browser code interacting with legacy DOM.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:20:40.970277+00:00— report_created — created