In JavaScript, null is a primitive value, but typeof reports it as what?

2025

In JavaScript, null is a primitive value, but typeof reports it as what?

  1. A.

    null

  2. B.

    object

  3. C.

    number

  4. D.

    string

  5. E.

    undefined

Attempted by 77 students.

Show answer & explanation

Correct answer: B

Correct answer: object.

In JavaScript, typeof null returns "object". This is a long-standing historical behavior of the language, even though null itself is a primitive value.

Explore the full course: Up Police Computer Operator

Loading lesson…