Master JavaScript Data Types: Essential Quiz for Developers

Test your knowledge of JavaScript data types with this comprehensive quiz. From understanding primitives and objects to differentiating between null, undefined, and more, this quiz is designed to strengthen your foundations and help you master JavaScript’s dynamic data types. Perfect for beginners and experienced developers alike!

Question 1.

What is the output of the following code?

  • A.

    null

  • B.

    object

  • C.

    undefined

  • D.

    string

Question 2.

Which of the following is a primitive data type in JavaScript?

  • A.

    Object

  • B.

    Array

  • C.

    Symbol

  • D.

    Function

Question 3.

What will be the result of the following code?

  • A.

    true

  • B.

    false

  • C.

    undefined

  • D.

    Error

Question 4.

Which JavaScript type is returned by typeof NaN?

  • A.

    number

  • B.

    NaN

  • C.

    undefined

  • D.

    object

Question 5.

Which of these is not a falsy value in JavaScript?

  • A.

    0

  • B.

    "false"

  • C.

    null

  • D.

    undefined

Question 6.

What is the output of the following?

  • A.

    array

  • B.

    object

  • C.

    undefined

  • D.

    function

Question 7.

What does typeof undefined return?

  • A.

    null

  • B.

    undefined

  • C.

    object

  • D.

    string

Question 8.

What will this output?

  • A.

    true

  • B.

    false

  • C.

    undefined

  • D.

    Error

Question 9.

What is the default type of a variable in JavaScript?

  • A.

    string

  • B.

    undefined

  • C.

    object

  • D.

    null

Question 10.

What is the value of typeof function() {}?

  • A.

    function

  • B.

    object

  • C.

    undefined

  • D.

    string

Question 11.

Which operator can be used to determine if a variable is an array?

  • A.

    typeof

  • B.

    Array.isArray()

  • C.

    instanceof

  • D.

    Both B and C

Question 12.

What does null mean in JavaScript?

  • A.

    No value

  • B.

    Undefined

  • C.

    An error

  • D.

    An object

Question 13.

What is the result of:

  • A.

    object

  • B.

    undefined

  • C.

    null

  • D.

    function

Question 14.

Which of these will correctly check if x is null?

  • A.

    typeof x === "null"

  • B.

    x === null

  • C.

    x == undefined

  • D.

    typeof x === "undefined"

Question 15.

What is the output?

  • A.

    102

  • B.

    8

  • C.

    "102"

  • D.

    NaN