Options
All
  • Public
  • Public/Protected
  • All
Menu

Module assign

Index

References

Interfaces

Functions

References

Renames and re-exports assign

Functions

  • assign<T>(a: T): T
  • assign<T1, T2>(a: T1, b: T2): T1 & T2
  • assign<T1, T2, T3>(a: T1, b: T2, c: T3): T1 & T2 & T3
  • assign<T>(...args: T[]): T
  • Create a new object/array with the own properties of the first entry merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    Note if first argument is array then result of function is array, otherwise it is an object.

    example

    assign({a:1}, {b:2}) //=> {a:1, b:2} assign([1,2,3], [4,5]) //=> [4,5,3]

    Type parameters

    • T

    Parameters

    • a: T

    Returns T

  • Create a new object/array with the own properties of the first entry merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    Note if first argument is array then result of function is array, otherwise it is an object.

    example

    assign({a:1}, {b:2}) //=> {a:1, b:2} assign([1,2,3], [4,5]) //=> [4,5,3]

    Type parameters

    • T1

    • T2

    Parameters

    • a: T1
    • b: T2

    Returns T1 & T2

  • Create a new object/array with the own properties of the first entry merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    Note if first argument is array then result of function is array, otherwise it is an object.

    example

    assign({a:1}, {b:2}) //=> {a:1, b:2} assign([1,2,3], [4,5]) //=> [4,5,3]

    Type parameters

    • T1

    • T2

    • T3

    Parameters

    • a: T1
    • b: T2
    • c: T3

    Returns T1 & T2 & T3

  • Create a new object/array with the own properties of the first entry merged with the own properties of the others objects. If a key exists in several objects, the value from the last object will be used.

    Note if first argument is array then result of function is array, otherwise it is an object.

    example

    assign({a:1}, {b:2}) //=> {a:1, b:2} assign([1,2,3], [4,5]) //=> [4,5,3]

    Type parameters

    • T

    Parameters

    • Rest ...args: T[]

    Returns T

Generated using TypeDoc