Function defaults

  • Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to undefined. Once a property is set, additional values of the same property are ignored.

    Note: This method mutates obj.

    Type Parameters

    • T
    • S

    Parameters

    • obj: T

      The destination object.

    • source: S

    Returns S & T

  • Type Parameters

    • T
    • S1
    • S2

    Parameters

    • obj: T
    • source1: S1
    • source2: S2

    Returns S2 & S1 & T

    defaults

  • Type Parameters

    • T
    • S1
    • S2
    • S3

    Parameters

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

    Returns S3 & S2 & S1 & T

    defaults

  • Type Parameters

    • T
    • S1
    • S2
    • S3
    • S4

    Parameters

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

    Returns S4 & S3 & S2 & S1 & T

    defaults

  • Type Parameters

    • T

    Parameters

    • obj: T

    Returns T

    defaults