Creates a new Object using all values from obj1 and obj2. If a value exists in both obj1 and obj2, the value in obj1 is used.
This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this function on shallow objects.
name | type | description |
---|---|---|
obj1 | object |
The first object. |
obj2 | object |
The second object. |
A new object containing the union of obj1's and obj2's properties.