Radash
  1. Number
  2. 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) // true
inRange(9.99, 0, 10) // true
inRange(Math.PI, 0, 3.15) // true
inRange(10, 10, 20) // true
inRange(10, 0, 10) // false

inRange(1, 2) // true
inRange(1, 0) // false