Why are typeof null
and undefined
objects instead of keywords or booleans in JavaScript?
For example,
(typeof null)
// "object"
(typeof undefined)
// "undefined"
But the thing is with undefined
is that it acts like an object without properties.
But typeof null
is an object.
Why are they objects and what is the point of them being objects without properties?