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 officially part of the spec, but it’s so widely used that it will likely be adopted in the future. You can check out the proposal on github.

Get hands-on with 1000+ tech skills courses.