...

/

Tip 12: Update Information with Object Spread

Tip 12: Update Information with Object Spread

In this tip, you’ll learn how the object spread operator gives you all the advantages of Object.assign() with reduced syntax.

You saw in the previous tip how you can use Object.assign() to make copies of objects and how you can overwrite object values with new values from another object. It’s a great tool that has a lot of value. But, wow—it’s ugly.

Object spread operator

The spread operator was such a popular addition in ES6 that similar syntax is being introduced for objects. The object spread operator is not ...