main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
860 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import createRange from './_createRange.js';
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * This method is like `_.range` except that it populates values in
|
---|
| 5 | * descending order.
|
---|
| 6 | *
|
---|
| 7 | * @static
|
---|
| 8 | * @memberOf _
|
---|
| 9 | * @since 4.0.0
|
---|
| 10 | * @category Util
|
---|
| 11 | * @param {number} [start=0] The start of the range.
|
---|
| 12 | * @param {number} end The end of the range.
|
---|
| 13 | * @param {number} [step=1] The value to increment or decrement by.
|
---|
| 14 | * @returns {Array} Returns the range of numbers.
|
---|
| 15 | * @see _.inRange, _.range
|
---|
| 16 | * @example
|
---|
| 17 | *
|
---|
| 18 | * _.rangeRight(4);
|
---|
| 19 | * // => [3, 2, 1, 0]
|
---|
| 20 | *
|
---|
| 21 | * _.rangeRight(-4);
|
---|
| 22 | * // => [-3, -2, -1, 0]
|
---|
| 23 | *
|
---|
| 24 | * _.rangeRight(1, 5);
|
---|
| 25 | * // => [4, 3, 2, 1]
|
---|
| 26 | *
|
---|
| 27 | * _.rangeRight(0, 20, 5);
|
---|
| 28 | * // => [15, 10, 5, 0]
|
---|
| 29 | *
|
---|
| 30 | * _.rangeRight(0, -4, -1);
|
---|
| 31 | * // => [-3, -2, -1, 0]
|
---|
| 32 | *
|
---|
| 33 | * _.rangeRight(1, 4, 0);
|
---|
| 34 | * // => [1, 1, 1]
|
---|
| 35 | *
|
---|
| 36 | * _.rangeRight(0);
|
---|
| 37 | * // => []
|
---|
| 38 | */
|
---|
| 39 | var rangeRight = createRange(true);
|
---|
| 40 |
|
---|
| 41 | export default rangeRight;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.