Loading...
Loading...
In JavaScript all data is divided into two types:
Primitives are basic types built into the language.
| Type | Example | Features |
|---|---|---|
string | "Hello" | Text string |
number | 42, 3.14 | Any number (integer and floating point) |
boolean | true, false | True or false |
null | null | Intentional absence of value |
undefined | undefined | Value wasn't assigned |
bigint | 900719925...n | Large numbers |
symbol | Symbol('id') | Unique identifiers |
ObjectArrayFunctionDate, RegExp, etc.Summary:
Primitives are simple, immutable values passed by value. Non-primitives are objects passed by reference.