document.all
is a non-primitive object in the DOM that is falsy.
For example, this code doesn\'t do anything:
if (document.all) {
al
Modern browsers don't implement this outdated thing any more. It was introduced by IE, but most of the others "shim" it to be compatible.
To make browser detection possible (back in the old days you could tell IE apart from NN by testing for document.all
) while supporting document.all syntax, other browsers made the "weird" implementation that typeof document.all
returns undefined.
Opera> document.all
// prints the array-like object
Opera> typeof document.all
"undefined"
Opera> Boolean(document.all)
false
Before FF dropped support for it, it also showed weird behaviour as stated in this message. You may find more internals in Mozilla bug #412247.
There is also a very long thread in the W3C mailing list archive, beginning with http://lists.w3.org/Archives/Public/public-html/2009Jun/0546.html