Methods
(inner) between(low, high, test) → {Boolean}
Takes a low number, and a high number, and a test value and returns true if the test value is between the range established by first and second args
Parameters:
Name | Type | Description |
---|---|---|
low |
Number | bottom of range |
high |
Number | top of range |
test |
Number | checks whether this val is within range |
Returns:
- Type
- Boolean
Example
const 1thru10 = between(1, 10);
const 1thru10(9) //=> true
const 1thru10(10) //=> true
const 1thru10(11) //=> false
const 1thru10(1) //=> true
const 1thru10(0) //=> false