Merges objects together, the rightmost objects overriding properties of earlier objects.
The return type is the intersection of all properties
const a = { name: `jane`, age: 30 };const b = { name: `fred`, age: 31, colour: `blue` };const c = mergeObjects(a, b);// Yields:// { name: `fred`, age: 31, colour: `blue` } Copy
const a = { name: `jane`, age: 30 };const b = { name: `fred`, age: 31, colour: `blue` };const c = mergeObjects(a, b);// Yields:// { name: `fred`, age: 31, colour: `blue` }
Alternatively, use mergeObjectsSameShape if the return shape should be based on the first object.
Merged object
Merges objects together, the rightmost objects overriding properties of earlier objects.
The return type is the intersection of all properties
Alternatively, use mergeObjectsSameShape if the return shape should be based on the first object.