mutable items meaning code example
Example 1: A mutable object
Mutable is a type of variable that can be changed.
In JavaScript, only Objects and Arrays(technically a type of object) are
mutable, not primitive(immutable) values.
Immutables are the objects whose state cannot be changed once the object is
created. Boolean, Null, Undefined, Number, String, and Symbols are immutable.
Example 2: what is immutable
'use strict';
const a = Object.freeze([4, 5, 6]);
const b = a.concat(7, 8, 9);
const c = a.slice(0, -1);
const d = [1, 2, 3].concat(a);
const e = a.slice(1);
const f = R.sort(myCompareFunction, a);
const g = R.reverse(a);