Object.assign() creates a copy of an object to a target object and returns this target object.
Now, if empty object is not provided as the first parameter, it may end up mutating the original object.
The example below demonstrates how mutation happens:
Top comments (0)