0% found this document useful (0 votes)
21 views1 page

009 Primitive-Vs-Reference-Values

JavaScript values are either primitive or reference types, with primitive types like strings and numbers stored directly in memory while reference types like objects are stored via pointers; copying a primitive value copies the value itself but copying a reference value copies the pointer.

Uploaded by

rockpaper12000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

009 Primitive-Vs-Reference-Values

JavaScript values are either primitive or reference types, with primitive types like strings and numbers stored directly in memory while reference types like objects are stored via pointers; copying a primitive value copies the value itself but copying a reference value copies the pointer.

Uploaded by

rockpaper12000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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