mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Document start and end swap for _.inRange. [ci skip] [closes #1332]
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user