Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
JavaScript has seven primitive types. Copying a primitive copies its value; copying an object reference makes both variables refer to the same object.
The primitive types are undefined, null, boolean, number, bigint, string, and symbol. In let a = 3; let b = a; b = 4, a remains 3. In const a = {count: 3}; const b = a; b.count = 4, a.count becomes 4 because both variables refer to the same object. Assigning a different object to b would not reassign a.