3 ms·
There are no immutable user defined data structures in JavaScript (and most of the built-in ones are mutable as well). They are "immutable" as an abstraction,
by partycoder 8y ago
There are no immutable user defined data structures in JavaScript (and most of the built-in ones are mutable as well).
They are "immutable" as an abstraction, but you can always mutate them in runtime.
const list = Immutable.List([1, 2, 3]);
list.map = function() { return 'poop'; }
console.log(list.map((e) => e));
Output: "poop"