variable can hold one of two value types:
primitive values or
Primitive valuesare data that are stored on the stack.
Primitive valueis stored directly in the location that the variable accesses.
Reference valuesare objects that are stored in the heap. (aka it’s stored elsewhere to preserve memory space and the variable is just a link to it).
Reference valuestored in the variable location is a pointer to a location in memory where the object is stored.
- 5 Primitive types:
String. Anything else is an object.
Objects are aggregations of properties. A property can reference an
object or a
Primitives are values, they have no properties.