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
Using the operator on a value produces a string that gives an indication of the type. Here are the possible values it can return:
Using the operator on a value produces a string that gives an indication of the type.
The typeof operator does not specify a type.
The unary typeof operator returns a string that is set according to various conditions. https://tc39.es/ecma262/#sec-typeof-operator
Table - "Table 41: Operator Result Type" does not give all variants of conditions.
A typical example is an object with an internal value of [[IsHTMLDDA]]. As a result of performing a type operation on such an object, the result will always be undefined.
For this reason, it is incorrect to say that - typeof gives an indication of the type. This is misleading.
The text was updated successfully, but these errors were encountered:
demimurych
changed the title
chapter-1.md: typeof The description is contrary to the specification.
The typeof description is contrary to the specification.
Jun 20, 2022
I intentionally used the vague term "indication". Meaning I'm not saying there is a on-to-one mapping between language type of result of typeof.
I agree it doesn't give the language type in every case meaning you can't rely fully on it for that. Still, I think it's fair to loosely describe its purpose as indicating the type of a value (and then explain when that isn't the case).
advanced-js-objects/chapters/chapter-1.md
Line 195 in ffb9953
The typeof operator does not specify a type.
The unary typeof operator returns a string that is set according to various conditions.
https://tc39.es/ecma262/#sec-typeof-operator
Table - "Table 41: Operator Result Type" does not give all variants of conditions.
A typical example is an object with an internal value of [[IsHTMLDDA]]. As a result of performing a type operation on such an object, the result will always be undefined.
For this reason, it is incorrect to say that - typeof gives an indication of the type. This is misleading.
The text was updated successfully, but these errors were encountered: