Primitive and Non-Primitive Data Types — a practical guide to JavaScript primitive vs object with clear examples you can reuse in real projects.
JavaScript Tutorial Series (13/101). Prefer one article? Read the complete JavaScript tutorial.
Short description
Mutating a shared object affects all references — a common source of bugs.
Reference tip
const a = { n: 1 };
const b = a;
b.n = 2;
console.log(a.n); // 2