override
The override() method replaces the properties of an object with those of another, ignoring undefined values.
Interactive example
Syntax
Classic signature
typescript
function override<
GenericInput extends object
>(
input: GenericInput,
value: Partial<NoInfer<GenericInput>>
): GenericInputCurried signature
typescript
function override<
GenericInput extends object
>(
value: Partial<NoInfer<GenericInput>>
): (input: GenericInput) => GenericInputParameters
input: The base object.value: A partial object containing the properties to replace.
Return value
A new object with the properties replaced (undefined values are ignored).
See also
assign- Merges multiple objects together
