JavaScript Internals (521 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)
What are primitive data types
A primitive data type is data that has a primitive value (which has no properties or methods). There are 7 types of primitive data types.
- string
- number
- boolean
- null
- undefined
- bigint
- symbol
Practical Code Example
javascript
// 7 Primitive Data Types in JavaScript (stored by value, immutable):
const str = "hello"; // string
const num = 42; // number
const big = 9007199254740991n; // bigint
const bool = true; // boolean
const sym = Symbol("id"); // symbol
const und = undefined; // undefined
const nul = null; // null