between
The between() method checks whether a number is inside an inclusive interval. It can be used in a curried way to ease functional composition.
Interactive example
Syntax
Classic signature
typescript
function between<
GenericInput extends number
>(
input: GenericInput,
greater: number,
less: number
): booleanCurried signature
typescript
function between<
GenericInput extends number
>(
greater: number,
less: number
): (input: GenericInput) => booleanParameters
input: The number to evaluate (classic signature only).greater: The inclusive lower bound.less: The inclusive upper bound.
Return value
returns true if input is within the interval [greater, less], false otherwise.
See also
betweenThan- Checks whether a number is inside an exclusive intervalgreater- Checks whether a number is greater than or equal (>=)less- Checks whether a number is less than or equal (<=)
