MCPcopy
hub / github.com/lodash/lodash / inRange

Function inRange

lodash.js:14134–14144  ·  view source on GitHub ↗

* Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _

(number, start, end)

Source from the content-addressed store, hash-verified

14132 * // => true
14133 */
14134 function inRange(number, start, end) {
14135 start = toFinite(start);
14136 if (end === undefined) {
14137 end = start;
14138 start = 0;
14139 } else {
14140 end = toFinite(end);
14141 }
14142 number = toNumber(number);
14143 return baseInRange(number, start, end);
14144 }
14145
14146 /**
14147 * Produces a random number between the inclusive `lower` and `upper` bounds.

Callers

nothing calls this directly

Calls 3

toFiniteFunction · 0.85
toNumberFunction · 0.85
baseInRangeFunction · 0.85

Tested by

no test coverage detected