Programming · Flashcard

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

  • ABoolean — an immutable primitive value holding true or false
  • BArray — an ordered, indexed collection of stored values
  • CObject — a keyed collection of properties and their values
  • DFunction — a callable, reusable block of program code

Why this is the answer

Boolean is a primitive — an immutable value, not an object. Arrays, objects, and functions are all objects (reference types), so none of them is a primitive.

Official docs
Study in Gnoseed →