Combining the properties from different objects is a fairly common task. Doing this value by value is limited and tedious, because each property has to be enumerated. This recipe demonstrates how to do the same thing with the Object.assign method.
Using Object.assign to add properties to an object
Getting ready
This recipe assumes you already have a workspace that allows you to create and run ES modules in your browser. If you don't, please see the first two chapters.
How to do it...
- Open your command-line application and navigate to your workspace.
- Create a new...