Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Primitive vs Reference Values

Two Categories of Types/ Values in


JavaScript

Primitive Values Reference Values

Strings, Numbers, Booleans, null, All other objects (“more expensive to


undefined, Symbol create”)

Stored in memory (normally on Stack), Stored in memory (Heap), variable stores


variable stores value itself a pointer (address) to location in memory

Copying a variable (= assign to different Copying a variable (= assign to different


variable) copies the value variable) copies the pointer/ reference

You might also like