
Data Types in JavaScript
A common warmup question during technical interviews is to name the different data types in JavaScript. Do you know all of them? By data types, we simply mean the type of value in JavaScript. For example, the following data type is a string:
Copied to clipboard! Playground
// The type od `data` is a string
const data = 'type';
// We can verify that by using `typeof`
// This will return "string"
typeof data;
We can verify that by using the typeof
operator on it. We can separate data types into two different categories:
- Primitives
- Complex
The latest ECMAScript standard defines nine different data types, from which seven are primitives and two are complex. In order theses are:
Primitive data types
Complex data types

Resources:
π More Webtips
Master the Art of Frontend
Access exclusive interactive lessons
Unlimited access to hundreds of tutorials
Remove ads to learn without distractions