Primitive vs Reference Types
The distinction between value types (numbers, strings, booleans) and reference types (objects, arrays, functions), and how it affects copying and comparison.
JavaScript has two broad categories of data: primitives and reference types, and how each is stored and copied has real consequences for how you write and debug code. This is a foundational concept that underlies closures, function arguments, equality checks, and immutability patterns, so interviewers use it to gauge whether your mental model of the language is solid.
A primitive is like handing someone a photocopy of a document — they can scribble on their copy without touching yours. A reference type is like handing someone the key to your apartment — anything they do inside changes the same apartment you both have access to.