企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## forOwnRight + [link](./forOwnRight "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L11093 "View in source.") + [npm](https://www.npmjs.com/package/lodash.forownright "See the npm package.") ``` _.forOwnRight(object, [iteratee=_.identity]) ``` 这个方法类似 `_.forOwn`。 除了它是反方向开始遍历的。 ### 参数 1. object (Object) 要遍历的对象 2. [iteratee=_.identity] (Function) 这个函数会处理每一个元素 ### 返回值 (Object) 返回对象 ### 示例 ``` function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // => 输出 'b' 然后 'a', `_.forOwn` 会输出 'a' 然后 'b' ```