The Seven Primitive Types
What you'll learn: The complete list of JavaScript's seven primitive types and what makes a value "primitive."
What Are Primitive Types?
In JavaScript, values are categorized into two main groups: primitives and objects. Primitives are the simplest, most basic forms of data—they're single, indivisible values that can't be broken down further. Think of them like atoms in chemistry: they're the fundamental building blocks.
The Seven Primitives
JavaScript has exactly seven primitive types:
- Number — any numeric value (integers and decimals)
- String — text wrapped in quotes
- Boolean — true or false
- Undefined — represents "no value assigned yet"
- Null — represents "intentionally empty"
- Symbol — unique identifiers (advanced use)
- BigInt — very large integers beyond Number's limit
What Makes a Value Primitive?
Primitives have two key characteristics:
- Immutable: Once created, a primitive value cannot be changed. You can create new values, but you can't modify the original.
- Stored by value: When you work with a primitive, you're working with the actual value, not a reference to it.
This is different from objects (like arrays and functions), which are stored by reference and can be modified after creation.
Why This Matters
Understanding primitives helps you predict how JavaScript handles your data. Each primitive type serves a specific purpose and behaves in predictable ways. In upcoming lessons, we'll explore each type in detail.
Key Takeaway: JavaScript has seven primitive types—Number, String, Boolean, Undefined, Null, Symbol, and BigInt—which are immutable, indivisible values that form the foundation of all JavaScript data.