Mutable

The difference between objects and primitive values is that we can change objects, whereas primitive values are immutable.

  1. var myPrimitive = "first value";
  2. myPrimitive = "another value";
  3. // myPrimitive now points to another string.
  4. var myObject = { key: "first value"};
  5. myObject.key = "another value";
  6. // myObject points to the same object.