The Object That Lies About Its Type
luljs still workstypeof document.all is "undefined", yet document.all is right there.
In 2026: Still works, uniquely. document.all is the old Internet Explorer way to reach page elements. To make ancient feature tests like if (document.all) fail on modern browsers, the standard gives it a special mode: typeof reports "undefined" and it loosely equals both undefined and null, even though the object exists and still works. It is the only value in the language that lies about its own type.
Where it came from: The standard marks document.all with a special IsHTMLDDA behaviour so old browser-sniffing fails safely; MDN's document.all page documents the disguise. MDN ↗
<script>
document.write('<p><code>typeof document.all</code> is <b>"' + (typeof document.all) + '"</b></p>');
document.write('<p><code>document.all == undefined</code> is <b>' + (document.all == undefined) + '</b></p>');
document.write('<p>Yet it works: <code>document.all.length</code> is <b>' + document.all.length + '</b> elements on this page.</p>');
</script>