O'Reilly logo

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond by JD Isaacks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 10. Object.assign

After reading lesson 10, you will

  • Know how to set default values with Object.assign
  • Know how to extend objects with Object.assign
  • Know how to prevent mutations when using Object.assign
  • Understand how Object.assign assigns values

Libraries like Underscore.js and Lodash.js have become like the utility belts of JavaScript. They add solutions to common tasks so that the average developer doesn’t need to reinvent the wheel for every project. Some of these tasks become so ubiquitous and well-defined that it makes sense to actually include them in the language. Object.assign is one such method. With it you can easily set default values or extend objects in place or as copies, all without having to write a lot of boilerplate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required