Document start and end swap for _.inRange. [ci skip] [closes #1332]

This commit is contained in:
John-David Dalton
2015-07-11 15:36:02 -07:00
parent 6d231fecd1
commit 56452d9fd8

View File

@@ -9567,6 +9567,8 @@
/** /**
* Checks if `n` is between `start` and up to but not including, `end`. If * 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`. * `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 * @static
* @memberOf _ * @memberOf _
@@ -9594,6 +9596,9 @@
* *
* _.inRange(5.2, 4); * _.inRange(5.2, 4);
* // => false * // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/ */
function inRange(value, start, end) { function inRange(value, start, end) {
start = +start || 0; start = +start || 0;