What does typeof null return in JavaScript?
Correct answer
B. "object"
16 views
B. "object"
16 views
typeof null === "object" is a long-standing quirk from JavaScript's first implementation that was kept for backward compatibility. To check for null, use value === null.
Asked in: Frontend Developer Tests, Technical Interviews
Not sure why the answer is B? Ask here and get an explanation.