A variable can hold one of two value types: primitive values or 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 include Undefined, Null, Boolean, Number, or String.