PRACTICE / UNDERSTAND / REPEAT

JavaScript: Values & types

Practice values & types with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

15 questionsAnswers explainedFree · no login
Question 1 of 15
Values & types · MCQQuestion link ↗

What does `typeof null` return in JavaScript?

Choose one answer
Answer & explanation

Answer: "object"

This is a longstanding JavaScript quirk: `null` is a primitive, but `typeof null` returns `"object"`.