As you see below there is an alternative way to mutate CONST data. So what about if you really wat your data to be frozen?
You can use Object.freeze for arrays but ES5 can freeze only objects and throws an error. ES6 enables to freeze non-objects, too.
Freeze method also blocks push, pop, shift and unshift methods :)
const array = [1, 2, 3]; array = [4, 5, 6]; // yes, it works! We can not mutate data but ... array = 4; // hmmm, now we have an alternative way to mutate data. console.log(array); // returns [4, 2, 3] Object.freeze(array); // The array cannot be modified. array = 1; // fails