> 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/collection/reduceright.md).

# \_.reduceRight（数组或对象迭代累加后的结果）

**语法：**

```javascript
_.reduceRight(collection, [iteratee=_.identity], [accumulator])
```

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

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

**描述：**

这个方法类似[`_.reduce`](https://lodash.com/docs/4.17.10#reduce)，除了它是从右到左遍历`collection`（集合）中的元素的。

**开始版本：**&#x30;.1.0

**参数：**

* `collection (Array|Object)`: 用来迭代的集合。
* `[iteratee=_.identity] (Function)`: 每次迭代调用的函数。
* `[accumulator] (*)`: 初始值。

**返回值：**

* `(*)`: 返回累加后的值。

**例子：**

```javascript
var array = [[0, 1], [2, 3], [4, 5]];

_.reduceRight(array, function(flattened, other) {
  return flattened.concat(other);
}, []);
// => [4, 5, 2, 3, 0, 1]
```
