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 = merge(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 = merge(a, b);// Yields:// { name: `fred`, age: 31, colour: `blue` }
Alternatively, use mergeSameShape 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 mergeSameShape if the return shape should be based on the first object.