πŸŽ„ Get 20% off from our JavaScript course for the holidays! πŸŽ„
Data Types in JavaScript

Data Types in JavaScript

Ferenc Almasi β€’ Last updated 2023 April 19 β€’ Read time 1 min read
  • twitter
  • facebook
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;
data-types.js

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

What are the possible data types in JavaScript
If you would like to see more Webtips, follow @flowforfrank

50 JavaScript Interview Questions

Resources:

Did you find this page helpful?
πŸ“š More Webtips
Frontend Course Dashboard
Master the Art of Frontend
  • check Access exclusive interactive lessons
  • check Unlimited access to hundreds of tutorials
  • check Remove ads to learn without distractions
Become a Pro

Recommended