Immutability, defined in a single line, means that once that value is assigned, then it can never be changed:
var string1 = "I am an immutable";var string2 = string1.slice(4, 8);
string1.slice does not change the value of string1. In fact, no string methods change the string they operate on, they all return new strings. The reason is that strings are immutable—they cannot change.
Strings are not the only immutable entity in JavaScript. Numbers, too, are immutable.