Function merge

  • Recursively merges own and inherited enumerable properties of source objects into the destination object, skipping source properties that resolve to undefined. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

    Note: This method mutates object.

    Type Parameters

    • T
    • S

    Parameters

    • object: T

      The destination object.

    • source: S

    Returns T & S

  • Type Parameters

    • T
    • S1
    • S2

    Parameters

    • object: T
    • source1: S1
    • source2: S2

    Returns T & S1 & S2

    merge

  • Type Parameters

    • T
    • S1
    • S2
    • S3

    Parameters

    • object: T
    • source1: S1
    • source2: S2
    • source3: S3

    Returns T & S1 & S2 & S3

    merge

  • Type Parameters

    • T
    • S1
    • S2
    • S3
    • S4

    Parameters

    • object: T
    • source1: S1
    • source2: S2
    • source3: S3
    • source4: S4

    Returns T & S1 & S2 & S3 & S4

    merge