inRange
Checks whether a number falls within [min, max] (both inclusive by default).
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | number | The number to test |
min | number | Lower bound |
max | number | Upper bound |
options | InRangeOptions | Boundary inclusion mode (default: 'both') |
Returns
Section titled “Returns”boolean — true if value is within the specified range
Examples
Section titled “Examples”Check if a value is within bounds (inclusive)
Section titled “Check if a value is within bounds (inclusive)”Both min and max are included by default.
Exclusive range
Section titled “Exclusive range”Use { inclusive: “none” } for open interval (min, max).
