JavaScript · Junior · Question 2 of 75

What does typeof null return?

Explanation

It's a historical bug from the language's first implementation, kept for compatibility. null is a separate primitive. Check for it with strict equality: value === null.

Further reading

Problem with a question

JavaScript · Junior · question 2

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz