Object assign

PHOTO EMBED

Fri Aug 26 2022 13:00:21 GMT+0000 (Coordinated Universal Time)

Saved by @SamMrch #javascript

//signature
Object.assign(target, ...sources)
var newState = Object.assign({}, state, action.state);
content_copyCOPY

The Object.assign() copies all enumerable and own properties from the source objects to the target object. It returns the target object. Object.assign() can be used to clone an object or merge objects.