forked from fdzcxy212206413/gsl_grs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
860 B
42 lines
860 B
1 month ago
|
import createRange from './_createRange.js';
|
||
|
|
||
|
/**
|
||
|
* This method is like `_.range` except that it populates values in
|
||
|
* descending order.
|
||
|
*
|
||
|
* @static
|
||
|
* @memberOf _
|
||
|
* @since 4.0.0
|
||
|
* @category Util
|
||
|
* @param {number} [start=0] The start of the range.
|
||
|
* @param {number} end The end of the range.
|
||
|
* @param {number} [step=1] The value to increment or decrement by.
|
||
|
* @returns {Array} Returns the range of numbers.
|
||
|
* @see _.inRange, _.range
|
||
|
* @example
|
||
|
*
|
||
|
* _.rangeRight(4);
|
||
|
* // => [3, 2, 1, 0]
|
||
|
*
|
||
|
* _.rangeRight(-4);
|
||
|
* // => [-3, -2, -1, 0]
|
||
|
*
|
||
|
* _.rangeRight(1, 5);
|
||
|
* // => [4, 3, 2, 1]
|
||
|
*
|
||
|
* _.rangeRight(0, 20, 5);
|
||
|
* // => [15, 10, 5, 0]
|
||
|
*
|
||
|
* _.rangeRight(0, -4, -1);
|
||
|
* // => [-3, -2, -1, 0]
|
||
|
*
|
||
|
* _.rangeRight(1, 4, 0);
|
||
|
* // => [1, 1, 1]
|
||
|
*
|
||
|
* _.rangeRight(0);
|
||
|
* // => []
|
||
|
*/
|
||
|
var rangeRight = createRange(true);
|
||
|
|
||
|
export default rangeRight;
|