Data Types and Type Conversion
Learn Data Types and Type Conversion (Phase 1 · Fundamentals, Variables, Data Types, Operators (Essential), JavaScript) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
The eight types • Primitives (immutable, compared by value): string , number , bigint , boolean , undefined , null , symbol . • Object (compared by reference): plain objects, arrays, functions, dates, maps and so on. • typeof reports the type as a string. Two famous quirks: typeof null is "object" (a historical bug) and typeof a function is "function" . • undefined means "no value assigned"; null means "intentionally empty".