I noticed that document.getElementById
is a function in Firefox and Chrome, while typeof
considers it an object in IE8 (at least).
Anyone has an idea why?
I noticed that document.getElementById
is a function in Firefox and Chrome, while typeof
considers it an object in IE8 (at least).
Anyone has an idea why?
IE8 (attempts to) implement ECMAScript 3 where the typeof
operator result is implementation defined for host objects regardless if the object implements [[call]]. In ES5, callable host objects must return "function"
.
See the table in ECMAScript 3
Compare to ECMAScript 5.1 http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.3