JavaScriptEasy
What are the various data types in JavaScript?
By FrontendPro Editorial Team Updated 8/8/2026
#JavaScript
Answer
In JavaScript, data types can be categorized into primitive and non-primitive types:
Primitive data types
- Number: Represents both integers and floating-point numbers.
- String: Represents sequences of characters.
- Boolean: Represents
trueorfalsevalues. - Undefined: A variable that has been declared but not assigned a value.
- Null: Represents the intentional absence of any object value.
- Symbol: A unique and immutable value used as object property keys. Read more in our deep dive on
Symbols. - BigInt: Represents integers with arbitrary precision.
Non-primitive (Reference) data types
- Object: Used to store collections of data.
- Array: An ordered collection of data.
- Function: A callable object.
- Date: Represents dates and times.
- RegExp: Represents regular expressions.
- Map: A collection of keyed data items.
- Set: A collection of unique values.
The primitive types store a single value, while non-primitive types can store collections of data or complex entities.
