Copy the values of all the enumerable own properties from one or more source objects to a new object.

This will use Object.assign using a new object as the target parameter.

One or more source objects from which to copy properties

  • Copy the values of all the enumerable own properties from one or more source objects to a new object.

    This will use Object.assign using a new object as the target parameter. Unlike Object.assign, the return type accounts for common keys.

    Type Parameters

    • T

    Parameters

    • source1: T

      The first source object from which to copy properties.

    Returns T

    Returns the new merged object.

  • Concatenates arrays.

    Type Parameters

    • T

    Parameters

    • Rest...sources: T[][]

    Returns T[]

    Returns a new concatenated array.

  • Copy the values of all the enumerable own properties from one or more source objects to a new object.

    This will use Object.assign using a new object as the target parameter. Unlike Object.assign, the return type accounts for common keys.

    Type Parameters

    • T
    • U

    Parameters

    • source1: T

      The first source object from which to copy properties.

    • source2: U

      The second source object from which to copy properties.

    Returns Merge<T, U>

    Returns the new merged object.

  • Copy the values of all the enumerable own properties from one or more source objects to a new object.

    This will use Object.assign using a new object as the target parameter. Unlike Object.assign, the return type accounts for common keys.

    Type Parameters

    • T
    • U
    • V

    Parameters

    • source1: T

      The first source object from which to copy properties.

    • source2: U

      The second source object from which to copy properties.

    • source3: V

      The third source object from which to copy properties.

    Returns Merge<Merge<T, U>, V>

    Returns the new merged object.

  • Copy the values of all the enumerable own properties from one or more source objects to a new object.

    This will use Object.assign using a new object as the target parameter. Unlike Object.assign, the return type accounts for common keys.

    Type Parameters

    • T
    • U
    • V
    • W

    Parameters

    • source1: T

      The first source object from which to copy properties.

    • source2: U

      The second source object from which to copy properties.

    • source3: V

      The third source object from which to copy properties.

    • source4: W

      The third source object from which to copy properties.

    Returns Merge<Merge<Merge<T, U>, V>, W>

    Returns the new merged object.

  • Copy the values of all the enumerable own properties from one or more source objects to a new object.

    This will use Object.assign using a new object as the target parameter. Unlike Object.assign, the return type accounts for common keys.

    Parameters

    • Rest...sources: any[]

    Returns any

    Returns the new merged object.