3 ms·
How Immutable Data Structures Are Optimized
- partycoder 8y agoThere 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"