isInRange
Checks whether the number falls inside an inclusive range. Both boundaries are included, so the method returns true when the number is exactly equal to min or max.
Usage
ts
const isValidPageSize = (25).isInRange(5, 100);
// trueParameters
min: number
Inclusive lower bound.
max: number
Inclusive upper bound.
Returns
true when the number is between min and max.Type signature
ts
interface Number {
isInRange(min: number, max: number): boolean;
}