5. 1. 6. Primitive and Reference Values |
|
A variable can hold one of two types of values: primitive values and reference values. |
Primitive values are data that are stored on the stack. |
Primitive value is stored directly in the location that the variable accesses. |
Reference values are objects that are stored in the heap. |
Reference value stored in the variable location is a pointer to a location in memory where the object is stored. |
Primitive types inlcude Undefined, Null, Boolean, Number, or String. |