This method is like range except that it populates values in descending order.
range
4.0.0
inRange, range
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)// => [] Copy
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)// => []
The start of the range.
Optional
The end of the range.
The value to increment or decrement by.
Returns the range of numbers.
This method is like
range
except that it populates values in descending order.Since
4.0.0
See
inRange, range
Example