btwn

Check if a number is in your min-max bounds.
- Lightweight
- Builds into the Number prototype
- 100% code coverage
Install
npm install btwn
...or...
yarn add btwn
Usage
require('btwn');
var x = 12;
if(x.btwn(1, 13)){
console.log("This number is under or equals to 13, and greater than or equals to 1.");
} else {
console.log("This number is under 1 or greater than 13.");
}
Docs
Number.btwn(min, max, [inclusive])
- min - Minimum value.
- max - Maximum value.
- inclusive - Are min and max inclusive. (Default: true)
To-do
Tests
Run mocha
.