Primitive Data Types
JavaScript has seven primitive data types: number, string, boolean, undefined, null, symbol (ES6), and bigint (ES2020). Primitives are immutable and compared by value.
// Exampleslet num = 42; // numberlet str = "hello"; // stringlet bool = true; // booleanlet und; // undefinedlet empty = null; // nulllet sym = Symbol("id"); // symbollet big = 123n; // bigintWe’ll explore each in the following sections.