just-in-range
v1.2.0
Published
Checks if number is within a given range
Downloads
23
Readme
just-in-range
Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.
npm install just-in-range
yarn add just-in-range
Check if number is within a given range
import inRange from 'just-number-in-range'
/*
inRange(2, 1, 10); // true
inRange(15, 20); // true
inRange(20, 21, 30); // false
inRange(30, 21, 30); // false
inRange(); // throws
inRange(100); // throws
inRange("js"); // throws
*/