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:

  • twitter
  • facebook
JavaScript
Did you find this page helpful?
πŸ“š More Webtips
Frontend Course Dashboard
Master the Art of Frontend
  • check Access 100+ interactive lessons
  • check Unlimited access to hundreds of tutorials
  • check Prepare for technical interviews
Become a Pro

Courses

Recommended

This site uses cookies We use cookies to understand visitors and create a better experience for you. By clicking on "Accept", you accept its use. To find out more, please see our privacy policy.