Primitives vs Objects & Core Types
Primitives vs objects; the seven primitives; quick typeof checks and common beginner pitfalls.
Intro
Goal: Tell primitives from objects and recognize all seven primitive types with quick checks.
- Seven primitives
- Objects vs wrappers
- typeof tour

Seven primitives: typeof tour
JavaScript has 7 primitives: number, bigint, string, boolean, null, undefined, symbol.
// Seven primitives and typeof
const n = 42;
// number
const bi = 42n;
// bigint
const s = "hello";
// string
const b = true;
// boolean
const u = undefined;
// undefined
const nl = null;
// null (primitive)
const sy = Symbol("id");
// symbol (unique each time)
console.log(typeof n, typeof bi, typeof s, typeof b);
console.log(typeof u, typeof nl, typeof sy);
// Note: typeof null is "object" (historical quirk)

All lessons in this course
- Primitives vs Objects & Core Types
- typeof, Truthy/Falsy, and == vs ===
- Type Coercion: Safe Patterns to Avoid Surprises