Typeof Null Result
Multiple Choice Beginner
Question
What does typeof null return in JavaScript?
Hint
This is a famous JavaScript bug that cannot be fixed for backward compatibility.
Explanation
typeof null returns "object" in JavaScript. This is a well-known bug dating back to the original implementation where type tags used the low bits, and null got the same tag as objects. Fixing it would break existing code, so it remains in the language specification.
Related Resources
Related Lessons
- Data Types
Learn about primitive data types.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.