Skip to content

Variables

assign()

const assign: <T, U>(target, source) => T & U<T, U, V>(target, source1, source2) => T & U & V<T, U, V, W>(target, source1, source2, source3) => T & U & V & W(target, ...sources) => any = Object.assign

Object.assign

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

Type Parameters

Type Parameter
T extends object
U

Parameters

ParameterTypeDescription
targetTThe target object to copy to.
sourceUThe source object from which to copy properties.

Returns

T & U

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

Type Parameters

Type Parameter
T extends object
U
V

Parameters

ParameterTypeDescription
targetTThe target object to copy to.
source1UThe first source object from which to copy properties.
source2VThe second source object from which to copy properties.

Returns

T & U & V

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

Type Parameters

Type Parameter
T extends object
U
V
W

Parameters

ParameterTypeDescription
targetTThe target object to copy to.
source1UThe first source object from which to copy properties.
source2VThe second source object from which to copy properties.
source3WThe third source object from which to copy properties.

Returns

T & U & V & W

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

Parameters

ParameterTypeDescription
targetobjectThe target object to copy to.
...sourcesany[]One or more source objects from which to copy properties

Returns

any