JavaScript Object.assign() MethodThe Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. Objects are assigned and copied by reference. It will return the target object. Syntax:Parametertarget: The target object. sources: The source object(s). Return value:This method returns the target object. Browser Support:
Example 1Output: 3 5 1 2 Example 2Output: 33 5 Example 3Output: 3 5 23 1
Next TopicJavaScript Objects
|
Javatpoint provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India