🌐
GeeksforGeeks
geeksforgeeks.org › javascript › primitive-and-non-primitive-data-types-in-javascript
Primitive and Non-primitive data-types in JavaScript - GeeksforGeeks
The two key non-primitive data types in JavaScript are: Below is a list of Non-primitive data types.
Published   July 23, 2025
🌐
Edureka
edureka.co › blog › data-types-in-javascript
What are the Different Data Types in JavaScript - Edureka
February 11, 2025 - Primitive data types are number, string, boolean, NULL, Infinity and symbol. Non-primitive data types is the object. The JavaScript arrays and functions are also objects.
People also ask

What are data types in JavaScript?
Data types in JavaScript define the kind of values you can store and use in a program. They help you manage and perform operations on different kinds of data efficiently.
🌐
wscubetech.com
wscubetech.com › resources › javascript › data-types
JavaScript Data Types: Primitive & Non-Primitive With Examples
How many data types are there in JavaScript?
There are two main data types in JavaScript: Primitive and Non-Primitive. Primitive data types include seven types: String, Number, Boolean, Null, Undefined, BigInt, and Symbol, while non-primitive types include Object, Array, and Function.
🌐
wscubetech.com
wscubetech.com › resources › javascript › data-types
JavaScript Data Types: Primitive & Non-Primitive With Examples
What are the different data types in JavaScript?
There are two major types of data types in JS:Primitive: String, Number, Null, Boolean, Undefined, BigInt, and SymbolNon-primitive: Object, Array, Function
🌐
wscubetech.com
wscubetech.com › resources › javascript › data-types
JavaScript Data Types: Primitive & Non-Primitive With Examples
🌐
WsCube Tech
wscubetech.com › resources › javascript › data-types
JavaScript Data Types: Primitive & Non-Primitive With Examples
November 5, 2025 - Learn about JavaScript data types: Primitive & Non-Primitive with examples. Explore strings, numbers, objects, arrays, and more in this comprehensive guide.
🌐
DEV Community
dev.to › mrizwanashiq › primitive-and-non-primitive-56n8
Primitive and Non-primitive - DEV Community
June 8, 2023 - Primitive data types such as string, number, null, undefined, and boolean, are passed by value while non-primitive data types such as objects, arrays, and functions are passed by reference.
🌐
Scaler
scaler.com › topics › non-primitive-data-types-in-javascript
Non-primitive data types in Javascript | Scaler Topics
November 15, 2022 - Objects in JavaScript are referred to as non-primitive data types in JavaScript. These data types are derived from JavaScript’s primitive data types.
🌐
DEV Community
dev.to › imashwani › javascript-non-primitive-data-types-2mjp
JavaScript Non-Primitive Data Types - DEV Community
April 2, 2024 - An array is indeed a reference to an ordered bunch of data in memory and likewise translates to 'object' when inspected by the typeof operator. In JavaScript, both arrays and objects are used to store and manipulate data, but they have some key differences.
🌐
W3Schools
w3schools.com › js › js_datatypes.asp
JavaScript Data Types
JavaScript Objects represent complex data structures and functionalities beyond the primitive data types (string, number, boolean, null, undefined, symbol, bigint).
🌐
GitConnected
levelup.gitconnected.com › primitive-vs-non-primitive-value-in-javascript-82030928fd9
Primitive vs Non-Primitive Value in Javascript? | by Ayush Tibra | Level Up Coding
June 15, 2022 - This is a common confusion among developers who assume that arrays are a special data type in Javascript. Now, these data types are broadly classified into 2 types: Primitive:- (String,Boolean,Number,BigInt,Null,Undefined,Symbol ) Non-Primitive:- Object (array, functions) also called object ...
Find elsewhere
Top answer
1 of 7
4
Data Types (JavaScript):

Primary Data Types
The primary (primitive) data types are:
String, Number, Boolean

Composite Data Types
The composite (reference) data types are:
Object, Array

Special Data Types
The special data types are:
Null, Undefined

Click here for details:

  var test1 = 1;
  var test2 = "Something";
  var test3 = true;
  var test4 = {};
  var test5 = new Array();
  var test6 = new Date();
  var test7;
  var test8 = null;

  alert(typeof (test1)); //number
  alert(typeof (test2)); //string
  alert(typeof (test3)); //boolean
  alert(typeof (test4)); //object
  alert(typeof (test5)); //object
  alert(typeof (test6)); //object
  alert(typeof (test7)); //undefined
  alert(typeof (test8)); //object
2 of 7
4

Javascript has five primitive data types: 1. number 2. string 3. boolean 4. undefined 5. null

Anything that doesn’t belong to any of these five primitive types is considered an object.

First 3 data types has a corresponding object constructor. For example

var word = "something";

And then as an object:

 var word = new String("something");

For object constructor notice the new keyword. It creates object reference.

Another thing to notice that

var greeting = "something";
var word = new String("something");
greeting == word ----> True as their value is same
greeting === word -----> False because there value same but type is different .

As for var keyword being same for all the cases,remember that Javascript is dynamically typed language. That means it resolves data type checking during runtime rather than compile time(like Java, C++ ).

This makes javascript extremely powerful. Though this unique feature has drawback too. Please co through this wikipedia for details: https://en.wikipedia.org/wiki/Type_system#Static_and_dynamic_type_checking_in_practice

Hope this helps.

🌐
Medium
medium.com › @Harshit_Raj_14 › data-types-in-javascript-d8ea72dd3ca9
Data Types in JavaScript. In JavaScript, data types are broadly… | by Harshit Raj | Medium
March 3, 2023 - Dates are a built-in non-primitive data type in JavaScript. They are used to represent dates and times, and can be created using the Date constructor.
🌐
ScholarHat
scholarhat.com › home
Data Types in JavaScript: Primitive & Non-Primitive
September 22, 2025 - Data types in JavaScript represent the type of value stored in the JavaScript variables. They are one of the fundamental concepts of the JavaScript programming language. In this JavaScript tutorial, we'll understand all the eight fundamental JavaScript data types with examples and the typeof operator in detail.
🌐
DEV Community
dev.to › js_catch › 02-primitive-and-non-primitive-data-types-in-javascript-2dhd
02 - Primitive and Non-Primitive Data Types in Javascript - DEV Community
July 2, 2020 - Thus Javascript allows us to work with Primitive as if they are objects. In order for that to work, a special “object wrapper” that provides the extra functionality is created because of which we can access those methods and then is destroyed after the work. Primitives except null and undefined provide many helpful methods The “object wrappers” are different for each primitive type and are called: String, Number, Boolean and Symbol.
🌐
StudySmarter
studysmarter.co.uk › javascript primitive data types
Javascript Primitive Data Types: Understanding & Examples
Non-Primitive Data Types: Also known as reference types, these include objects, arrays, and functions. They hold references to memory locations, not the actual data values. Consider the following JavaScript code that showcases the difference:
🌐
Hyperskill
hyperskill.org › university › javascript › javascript-data-types
JavaScript Data Types
July 22, 2024 - Non-primitive data types are mutable and are stored by reference. For example, an object variable would store a reference to the location in memory where the object's data is stored. Each data type has its unique attributes and is used for different purposes in JavaScript.
🌐
MSR
rajamsr.com › home › top 6 non primitive data types in javascript
Top 6 Non Primitive Data Types In JavaScript | MSR - Web Dev Simplified
February 29, 2024 - Discover the non primitive data types in JavaScript, including Arrays, Maps, Sets, WeakMaps, and WeakSets with examples.
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
Programming languages all have built-in data structures, but these often differ from one language to another. 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.
🌐
TutorialsTeacher
tutorialsteacher.com › javascript › javascript-data-types
Overview of Data Types in JavaScript
Example: A Variable with Different Types of Data Copy · let myvariable = 1; // numeric value myvariable = 'one'; // string value myvariable = true; // Boolean value ... In the above example, different types of values are assigned to the same variable to demonstrate the loosely typed characteristics of JavaScript. Here, 1 is the number type, 'one' is the string type, and true is the boolean type. JavaScript includes primitive and non-primitive data types as per the latest ECMAScript 5.1 specification.