Object Destructuring: The Role of the Spread Operator
Learn the importance of the spread operator’s role in extracting extra or fewer values and copying the whole object.
We'll cover the following...
Extracting with ...
In the previous lessons on object destructuring examples, we have extracted part of the object, leaving behind some properties. Sometimes, we want to copy the whole object, and at the same time, maybe add new properties or change the values of existing properties. Destructuring can do this quite well.
Using destructuring to copy object properties
For example, the popular JavaScript state container library Redux is based on the immutable state. Instead of modifying existing objects, it transforms them into new objects. Typically, a ...
Access this course and 1400+ top-rated courses and projects.