You can test it using typeof operator:

The typeof operator gives you the names of data types when placed before any single operand.

Hence, try using typeof with any operand variable: it will give one of the following datatype names:

  1. String
  2. Number
  3. Boolean
  4. Object
  5. Undefined

Hence, these are the five data Types in Javascript.

var val1 = "New World";   //returns String
var val2 = 5;             //returns Number
var val3 = true;          //returns Boolean
var val4 = [1,2,3];       //returns Object
var val5 = null;          //returns Object (Value is null, but type is still an object)
var val6;                 //returns Undefined
Answer from svik on Stack Overflow
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Data types
A value in JavaScript is always of a certain type. For example, a string or a number. There are eight basic data types in JavaScript.
An Introduction to JavaScript
CoffeeScript is “syntactic sugar” for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it. TypeScript is concentrated on adding “strict data typing” to simplify the development and support of complex systems.
JavaScript Fundamentals
Indonesia · Italiano · 日本語 · 한국어 · Русский · Türkçe · Українська · Oʻzbek · 简体中文 · Tutorial · The JavaScript language · Let’s learn the fundamentals of script building. Hello, world! Code structure · The modern mode, "use strict" Variables · Data types ...
Export and Import
Here are all types of export that we covered in this and previous articles.
People also ask

How do I check the data type of a variable in JavaScript?
You can use the "typeof" operator followed by the variable name to determine its data type. For example, "typeof myVariable" will return a string indicating the data type.
🌐
shiksha.com
shiksha.com › home › it & software › it & software articles › programming articles › introduction to javascript data types with examples
Introduction to JavaScript Data Types With Examples - Shiksha Online
Can JavaScript variables change their data type?
Yes, JavaScript variables are dynamically typed, which means they can hold different data types at different times. A variable can be assigned a number and later assigned a string or any other data type.
🌐
shiksha.com
shiksha.com › home › it & software › it & software articles › programming articles › introduction to javascript data types with examples
Introduction to JavaScript Data Types With Examples - Shiksha Online
What is the difference between null and undefined in JavaScript?
"null" is a value that represents the intentional absence of any object value, while "undefined" is a value that indicates the absence of a defined value. "null" is assigned by developers, whereas "undefined" is the default value for variables that have been declared but not assigned a value.
🌐
shiksha.com
shiksha.com › home › it & software › it & software articles › programming articles › introduction to javascript data types with examples
Introduction to JavaScript Data Types With Examples - Shiksha Online
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-data-types
JavaScript Data Types - GeeksforGeeks
JavaScript data types determine the nature of data stored in variables, affecting how values are processed and interacted with in the code. Each data type has specific properties and behavior that impact how data is stored, accessed, and manipulated.
Published   October 5, 2025
🌐
BrainStation®
brainstation.io › learn › javascript › data-types
JavaScript Data Types (2025 Tutorial & Examples) | BrainStation®
February 4, 2025 - Sometimes it could be a logical ... known as primitive data types. JavaScript as a language provides the following eight basic data types:...
🌐
W3Schools
w3schools.com › js › js_datatypes.asp
JavaScript Data Types
In programming, data types is an important concept. To be able to operate on variables, it is important to know something about the type. Without data types, a computer cannot safely solve this: ... Does it make any sense to add "Volvo" to sixteen? Will it produce an error or will it produce a result? ... When adding a number and a string, JavaScript will treat the number as a string.
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures. The language overview offers a similar summary of the common data types, but with more comparisons to other languages.
Find elsewhere
🌐
Tutorial Republic
tutorialrepublic.com › javascript-tutorial › javascript-data-types.php
Understanding the JavaScript Data Types - Tutorial Republic
There are six basic data types in JavaScript which can be divided into three main categories: primitive (or primary), composite (or reference), and special data types. String, Number, and Boolean are primitive data types.
🌐
Shiksha
shiksha.com › home › it & software › it & software articles › programming articles › introduction to javascript data types with examples
Introduction to JavaScript Data Types With Examples - Shiksha Online
September 13, 2023 - Explore the fundamental data types in JavaScript - numbers, strings, booleans, arrays, objects, null, & undefined. Click here to dive deeper!
🌐
Edureka
edureka.co › blog › data-types-in-javascript
What are the Different Data Types in JavaScript - Edureka
February 11, 2025 - Types are values that JavaScript can have. Below is a list of data types that JavaScript can have: ... The ‘Symbol’ data type is new in JavaScript. It has been included in the ES6 version. We can find the type of value or data by using the ‘typeof’ JavaScript operator.
🌐
Hellojavascript
hellojavascript.info › general javascript questions › javascript fundamentals › data types
Data Types - JavaScript Interview Questions | HelloJavaScript.info
There are eight basic data types in JavaScript including Number, String, Boolean, BigInt, Null, Undefined, Object, and Symbol. JS Frontend Interview Questions
🌐
Topcoder
topcoder.com › thrive › articles › javascript-data-types-objects-and-methods
Javascript Data Types, Objects, and Methods
JavaScript supports eight basic data types. String - It helps store textual data. ... Number - It stores a decimal or non-decimal number. ... BigInt - It stores numbers greater than 253-1 which are not permissible in number data type.
🌐
Codecademy
codecademy.com › docs › javascript › data types
JavaScript | Data Types | Codecademy
May 15, 2024 - Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity. Beginner Friendly.Beginner Friendly15 hours15 hours · JavaScript uses seven primitive data types that are listed in the table below:
🌐
Medium
medium.com › @aysunitai › javascript-data-types-1fcf287ed734
JavaScript Data Types. In JavaScript, there are seven… | by aysunitai | Medium
March 7, 2023 - In JavaScript, there are seven primitive data types: number, string, boolean, null, undefined, bigInt, and symbol. In addition to these…
🌐
Medium
medium.com › @mila.mirovic98 › javascript-fundamentals-data-types-a805f83f0272
JavaScript fundamentals: Data Types | by Mila Mirovic | Medium
October 14, 2023 - We delve into the intricacies of data types, covering eight main types, including primitives like boolean, number, string, bigInt, symbol, null, and undefined, as well as the Object type.
🌐
Javatpoint
javatpoint.com › javascript-data-types
JavaScript data types - javatpoint
JavaScript data types tutorial for beginners and professsionals with example, JavaScript primitive data types, JavaScript primitive data types, event, validation, object loop, array, document, tutorial
🌐
Medium
geraldclarkaudio.medium.com › jaascript-data-types-cecb3b0102d8
JavaScript Data Types | by Gerald Clark | Medium
May 7, 2024 - JavaScript Data Types In JavaScript we work with many different data types. There are 7 to be exact. Number String Boolean Null Undefined Object Symbol. I’ll briefly go over these here, but later …
🌐
Metana
metana.io › metana | career-focused coding bootcamp › full-stack › javascript data types - metana
JavaScript Data Types - Metana
March 24, 2025 - Understanding JavaScript data types is fundamental for any developer working with this language. Whether dealing with primitive types or more complex reference types like objects and arrays, each type plays an important role in how you store, manipulate, and process data in your programs.
🌐
DEV Community
dev.to › _ndeyefatoudiop › javascript-data-types-27-quick-questions-you-need-to-master-1828
✨🧱 JavaScript Data Types: 27 Quick Questions You Need To Master - DEV Community
June 3, 2024 - Every value in JavaScript has a specific type. This type determines what operations can be performed on the value and how it's stored 🗳️. This is known as the data type.