var demo = null; typeof demo; // "object"
The reason for this is that
typeof will always return
A fix that would have resulted in
typeof null === "null" has been proposed (via an opt-in), but was rejected as it was too late to fix the “problem” as a change of
typeof null would break existing code like incorrect implementations of type checks.