Non-primitive values are mutable
The following is a list (array) of people assigned to a variable:
let person = ['John', 'Macmahon', 'Arnold', 'Ziglar'] person = 'Schednegar' console.log(person) // Output: Array ["Schednegar", "Macmahon", "Arnold", "Ziglar"]
Primitive values are immutable
The following is a text (string) value that gets assigned to a variable
let person = 'John' person = 'A' console.log(person) // output: John
This cannot be changed because the string is a primitive value. So primitive values are immutable means, not they cannot be changed.