> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/util/rangeright.md).

# \_.rangeRight

**语法：**

```javascript
_.rangeRight([start=0], end, [step=1])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L15989)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.rangeright)

**描述：**

这个方法类似[`_.range`](https://lodash.com/docs/4.17.10#range)， 除了它是降序生成值的。

**开始版本：**&#x34;.0.0

**参数：**

* `[start=0] (number)`: 开始的范围。
* `end (number)`: 结束的范围。
* `[step=1] (number)`:范围的增量 或者 减量。

**返回值：**

* `(Array)`: 返回范围内数字组成的新数组。

**例子：**

```javascript
_.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);
// => []
```
