Courses / JavaScript
51. Object.assign()
Copies all enumerable own properties from one or more source objects to a target object.
1 min read Chapter 51 of 99
JavaScript
Object.assign()
Object.assign() is a method that copies properties from source objects to a target object.
"I want to merge multiple objects into one without losing any properties."
Object.assign() takes a target object and one or more source objects, copying all enumerable own properties from the sources to the target.
"I want to merge multiple objects into one without losing any properties."
Object.assign() takes a target object and one or more source objects, copying all enumerable own properties from the sources to the target.