You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks odd that in the Type column, only "number" is in orange, rather than red.
I forget when this happened, but Nitro and V8 now return "object" instead of "function" for regular expressions.
Also, it should be noted that typeof null === "object"; and the spec authors have not been able to fix it without breaking existing code, and it might be noted that in older versions of IE, certain host objects can have the typeof value "unknown" and apparently "date" (although I've never figured out what values have that typeof value), even though MSDN does not mention these; also in those older versions of IE, some DOM methods have the typeof value "object" and do not have the Function.prototype methods, even though, as callable objects, they are functions (as with the previous note, this might complicate things unnecessarily).
A more minor issue is that typeof also returns "undefined" for the undefined value, not just for undeclared variables; an oddity from the HTML5 spec is that if document.all is implemented (for compatibility with oldIE), it must also have the typeof value "undefined", and an ES6-specific change is that if typeof is used on a let- or const-declared variable inside its scope, but before the declaration is reached (that is, in the Temporal Dead Zone, or TDZ), it will throw a ReferenceError.
Finally, another ES6-specific addition is that symbols have the typeof value "symbol" and the [[Class]] property "Symbol"; because the Symbol constructor may not be constructor-called, a Symbol wrapper object would be created with new Object(Symbol()), and as expected, its [[Class]] property is "Symbol" and its typeof value is "object".
The text was updated successfully, but these errors were encountered:
It looks odd that in the Type column, only "number" is in orange, rather than red.
I forget when this happened, but Nitro and V8 now return
"object"
instead of"function"
for regular expressions.Also, it should be noted that
typeof null === "object";
and the spec authors have not been able to fix it without breaking existing code, and it might be noted that in older versions of IE, certain host objects can have the typeof value"unknown"
and apparently"date"
(although I've never figured out what values have thattypeof
value), even though MSDN does not mention these; also in those older versions of IE, some DOM methods have the typeof value"object"
and do not have theFunction.prototype
methods, even though, as callable objects, they are functions (as with the previous note, this might complicate things unnecessarily).A more minor issue is that
typeof
also returns"undefined"
for the undefined value, not just for undeclared variables; an oddity from the HTML5 spec is that ifdocument.all
is implemented (for compatibility with oldIE), it must also have the typeof value"undefined"
, and an ES6-specific change is that iftypeof
is used on alet
- orconst
-declared variable inside its scope, but before the declaration is reached (that is, in the Temporal Dead Zone, or TDZ), it will throw aReferenceError
.Finally, another ES6-specific addition is that symbols have the typeof value
"symbol"
and the[[Class]]
property"Symbol"
; because theSymbol
constructor may not be constructor-called, a Symbol wrapper object would be created withnew Object(Symbol())
, and as expected, its[[Class]]
property is"Symbol"
and its typeof value is"object"
.The text was updated successfully, but these errors were encountered: