add
The add() method adds two numbers or creates a partially applied addition function. It can be used in a curried way to ease functional composition.
Interactive example
Syntax
Classic signature
typescript
function add<
GenericInput extends number
>(
input: GenericInput,
operand: number
): numberCurried signature
typescript
function add<
GenericInput extends number
>(
operand: number
): (input: GenericInput) => numberParameters
input: The base number to which the operand is added (classic signature only).operand: The number to add to the value.
Return value
returns the sum of the two numbers (input + operand).
