ECMAScript defines 8 data types: Undefined, Boolean, Number, Null, BigInt, String, Object, Symbol.
It is important to note that the typeof
operator can return values that do not comply with the standard.
The typeof
operator returns the string 'function' for functions, although ECMAScript does not define this type. This is done for convenience.
Also typeof
returns the string 'object' for null
. This error is not fixed intentionally, so as not to break backward compatibility for already written code.