ixfx
    Preparing search index...

    Function mergeObjects

    • 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` }

      Alternatively, use mergeObjectsSameShape if the return shape should be based on the first object.

      Type Parameters

      • A extends object[]

      Parameters

      • ...a: [...A[]]

      Returns Spread<A>

      Merged object