typeof Operator
The typeof operator can be used to determine the type of a variable. It returns a string representing the datatype of the value.
The typeof operator has two forms, an operator or a function.
The typeof operator applied to the null value returns the value "object", which is actually a bug. It should return "null", but has been left as it is due to code depending on the original return value.
Last updated
Was this helpful?