Completion requirements
Description
The following table summarizes the possible return values of typeof
. For
more information about types and primitives, see also the JavaScript data structure page.
Type | Result |
---|---|
Undefined | "undefined" |
Null | "object" (see below) |
Boolean | "boolean" |
Number | "number" |
BigInt | "bigint" |
String | "string" |
Symbol | "symbol" |
Function (implements [[Call]] in ECMA-262 terms; classes are functions as well) | "function" |
Any other object | "object" |
Note: ECMAScript 2019 and older permitted implementations to have
typeof
return any implementation-defined string value for non-callable
non-standard exotic objects.
The only known browser to have actually taken advantage of this is old Internet Explorer.