You can see what data types are primitives here on MDN: https://developer.mozilla.org/en-US/docs/Glossary/Primitive Technically, the differences can be subtle, but the big difference is that primitives are immutable, meaning you can't add to or modify properties within them like you can with objects. While you can have objects that are also immutable, primitives are always immutable. If you ever need to change a primitive value, it always has to be reassigned. It can't be modified. Primitives also generally represent a low-level value, not something complex. Things like numbers, strings and booleans make up primitives while more complex types like Dates and Arrays are defined by objects. Most primitives also have object variations of themselves. For example you can have the primitive number 5 or the number object new Number(5). However, you should almost always avoid the object version of primitive types and stick to using their primitive values. Answer from senocular on reddit.com
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › primitive-and-non-primitive-data-types-in-javascript
Primitive and Non-primitive data-types in JavaScript - GeeksforGeeks
These data types are broadly categorized into two groups: Primitive Data Types and Non-Primitive Data Types. Let us discuss it one by one. Primitive data types are the built-in data types provided by JavaScript.
Published   July 23, 2025
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
July 8, 2025 - For symbols and BigInts, JavaScript has intentionally disallowed certain implicit type conversions. All types except Object define immutable values represented directly at the lowest level of the language. We refer to values of these types as primitive values.
Discussions

What is the difference between primitive and non-primitive data types? When are both used? Can you use them synonymously?
You can see what data types are primitives here on MDN: https://developer.mozilla.org/en-US/docs/Glossary/Primitive Technically, the differences can be subtle, but the big difference is that primitives are immutable, meaning you can't add to or modify properties within them like you can with objects. While you can have objects that are also immutable, primitives are always immutable. If you ever need to change a primitive value, it always has to be reassigned. It can't be modified. Primitives also generally represent a low-level value, not something complex. Things like numbers, strings and booleans make up primitives while more complex types like Dates and Arrays are defined by objects. Most primitives also have object variations of themselves. For example you can have the primitive number 5 or the number object new Number(5). However, you should almost always avoid the object version of primitive types and stick to using their primitive values. More on reddit.com
🌐 r/learnjavascript
4
1
April 11, 2023
javascript - Successfully changed the Immutable or Primitive Data-Types in JS. Then How these are Primitives or is JS Concepts wrong? - Stack Overflow
As I know there are 4 primitives in JS (those that store value directly, rather than reference to another memory location) - String, Number, Boolean, Symbol. I am not counting undefined, null - as ... More on stackoverflow.com
🌐 stackoverflow.com
Everything in JavaScript is an object...what about primitive data types?
Primitives are not objects. When you call a method on them they are temporarily wrapped in an object and unwrapped when the method is executed. More on reddit.com
🌐 r/learnjavascript
36
57
June 11, 2022
Confusion between Objects and primitive data types in Js
Now, cat is a variable of data type of object, and the object data represents the different key/value pairs (propreties), or the cat is an object? It's the same thing. Technically cat is a variable, and it holds an object (to be even more technical, it holds a reference to an object, but that's not the point). Saying "cat is an object" is a fairly common colloquial way to describe a variable and its type. For instance... let x = 1; I might say "x is a number". It's actually a variable that holds a number, but programmers are going to understand that's what I meant. More on reddit.com
🌐 r/learnprogramming
5
1
May 4, 2022
🌐
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.
🌐
W3Schools
w3schools.com › js › js_datatypes.asp
JavaScript Data Types
In the first example, JavaScript treats 16 and 4 as numbers, until it reaches "Volvo". In the second example, since the first operand is a string, all operands are treated as strings. JavaScript has dynamic types. This means that the same variable can be used to hold different data types:
🌐
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.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Primitive
Primitive - Glossary | MDN
In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods or properties. There are 7 primitive data types:
🌐
Medium
medium.com › @dulshansagara6 › lesson-04-understanding-non-primitive-data-types-in-javascript-75f9997283db
Lesson 04: Understanding Non-Primitive Data Types in JavaScript | by Dulshan Senadheera | Medium
July 13, 2024 - Unlike primitive types, which store actual values, non-primitive types store references to the values. This means that when you manipulate a non-primitive type, you’re working with a reference to the original value, not a copy.
Find elsewhere
🌐
GreatFrontEnd
greatfrontend.com › interviews › gfe75
GFE 75 - 75 Most Important Front End Interview Questions
Type Utilities IIImplement utilities to determine non-primitive variable types in JavaScript · JavaScript functions · JS functionsDifficulty · Easy · Languages · 15 · Promise.allImplement the Promise.all() function that resolves to an array of results if all the input elements are resolved or rejects otherwise · JavaScript functions · JS functionsDifficulty · Medium · Languages · 16 · Data MergingImplement a function to merge rows of data from the same user ·
Top answer
1 of 3
2

You are not mutating the existing primitives. You're simply assigning new primitive values (which are immutable as well) to the existing variable names.

Mutation is not the same thing as variable name reassignment. Mutation looks something like the following:

someObj.someProp = newPropVal;

Reassignment is:

someVarName = newVal;

Primitives don't have own-properties; trying to assign to a property of a primitive doesn't do anything and will throw an error in strict mode, because primitives are immutable.

Here's one way of looking at it (it's a nice visualization, though it's necessarily an accurate reflection of what's actually happening in the bytecode): values reference a location in memory. Variable names point to locations in memory. Say that false corresponds to memory location 1234, and you create an object {} which corresponds to memory location 9999. You can assign false to a variable name and have that variable name point to location 1234 in memory. You can reassign the value that the variable name points to by using location 9999 instead, that points to the object. The object, unlike the primitive, is a potential container for other values (and other memory locations). The primitive cannot act as such a container.

2 of 3
1

your means to change primitives are only reassigning the variable's reference to the stack

var a = 1;
a = 2;

here a is a reference address to the execute stack. Above reassignment only changes the address in stack, not 1 itself. If 1 is stored in address ****, after the reassignment, 1 is still located at ****, but a now points to 2's address in stack

🌐
Medium
medium.com › @gourabb68 › primitive-vs-non-primitive-data-type-in-javascript-6419aaecd96c
Primitive vs Non-Primitive data type in JavaScript | by Gourab Banerjee | Medium
July 19, 2020 - Primitive vs Non-Primitive data type in JavaScript Primitive data types in JavaScript are number, string, boolean, null, undefined, symbol (new in ECMAScript 2015) Whereas undefined and null are …
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-data-types
JavaScript Data Types - GeeksforGeeks
The largest number that JavaScript can reliably represent with the Number primitive is 253, which is represented by the MAX_SAFE_INTEGER constant. ... The data types that are derived from primitive data types are known as non-primitive data types.
Published   January 19, 2026
🌐
FlatCoding
flatcoding.com › tutorials › javascript › data-types-in-javascript-primitive-and-non-primitive
Data Types in JavaScript: Primitive and Non-Primitive
June 23, 2025 - JavaScript archives provide you with a list of articles to help you develop skills. Click here to see more articles with examples.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String
String - JavaScript | MDN
Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.) String literals (denoted by double or single quotes) and strings returned from String calls in a non-constructor context (that is, called without using the new keyword) are primitive strings.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Data types
All other types are called “primitive” because their values can contain only a single thing (be it a string or a number or whatever). In contrast, objects are used to store collections of data and more complex entities.
🌐
Zod
zod.dev › api
Defining schemas | Zod
To validate data, you must first define a schema. Schemas represent types, from simple primitive values to complex nested objects and arrays.
🌐
Programiz
programiz.com › javascript › data-types
JavaScript Data Types (with Examples)
String, Number, BigInt, Boolean, undefined, null, and Symbol are primitive data types. Non-Primitive Data Types: They can hold multiple values. Objects are non-primitive data types. A string represents textual data. It contains a sequence of characters. For example, "hello", "JavaScript", etc.
🌐
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.
🌐
HTML Standard
html.spec.whatwg.org
HTML Standard
Authors can embed raw data using the <script type=""> mechanism with a custom type, for further handling by inline or server-side scripts. Authors can extend APIs using the JavaScript prototyping mechanism.