PRIMITIVE AND REFERENCE VALUES
ECMAScript variables may contain two different types of data: primitive values and reference values. Primitive values are simple atomic pieces of data, while reference values are objects that may be made up of multiple values.
When a value is assigned to a variable, the JavaScript engine must determine if it's a primitive or a reference value. The six primitive types were discussed in the previous chapter: Undefined, Null, Boolean, Number, String, and Symbol. These variables are said to be accessed by value, because you are manipulating the actual value stored in the variable.
Reference values are objects stored in memory. Unlike other languages, JavaScript does not permit direct access of memory locations, so direct manipulation of the object's memory space is not allowed. When you manipulate an object, you're really working on a reference to that object rather than the actual object itself. For this reason, such values are said to...