subtract
The subtract() method subtracts one number from another. It supports two forms: a curried form for functional composition and a direct form for immediate calculation.
Interactive example
Syntax
Classic signature
typescript
function subtract<
GenericInput extends number
>(
input: GenericInput,
subtrahend: number
): numberCurried signature
typescript
function subtract<
GenericInput extends number
>(
subtrahend: number
): (input: GenericInput) => numberParameters
input: The number from which to subtract (classic signature only).subtrahend: The number to subtract.
Return value
Classic signature: returns the result of the subtraction (value - subtrahend).
See also
add- Adds two numbersnegate- Inverts the sign of a numberabs- Returns the absolute value of a number
