inRange
Basic usage
Pass the number, the start and the end (optional) of the range. The _.inRange
function will return true if the given number is in the range.
import { inRange } from 'radash'
inRange(10, 0, 20) // trueinRange(9.99, 0, 10) // trueinRange(Math.PI, 0, 3.15) // trueinRange(10, 10, 20) // trueinRange(10, 0, 10) // false
inRange(1, 2) // trueinRange(1, 0) // false