- Primitive: stored as simple data (strings, numbers)
- Reference: stored as objects (references to locations in memory)
To see if something is a primitive, use typeof
.
Except with null
. That'll say it's an object. Because JavaScript.
To see if something is a primitive, use typeof
.
Except with null
. That'll say it's an object. Because JavaScript.