Chapter 2
Functional Programming in ES6
Section 2
Deep and Shallow Cloning in JavaScript
Using immutable data structures is a cornerstone of functional programming. Yet, the JavaScript support for immutability is not that obvious. This video raises awareness on the different types of cloning, and makes sure we don’t end up mutating our data. - Experiment with shallow cloning using an interactive example with an object diagram - Compare shallow cloning to deep cloning using the same object diagram - Determine when it is worth for you to implement your own cloning method, and when it makes sense to use libraries