re: Functional vs Imperative Patterns in JavaScript VIEW POST


Shallow clones are tricky. I usually end up having to implement deep cloning when using the pattern you mentioned.


If you allow mutations, you have to deep clone. If you disallow mutations, shallow cloning is enough.

This is how libraries like list or immutable.js are so fast. They disallow mutations.

One of the advantages of FP.

code of conduct - report abuse