Lodash

是一个一致性、模块化、高性能的 JavaScript 实用工具库。

“Object” Methods

_.forInRight(object, [iteratee=_.identity])

这个方法类似 _.forIn。 除了它是反方向开始遍历object的。

添加版本

2.0.0

参数

  1. object (Object): 要遍历的对象。
  2. [iteratee=_.identity] (Function): 每次迭代时调用的函数。

返回

(Object): 返回 object

例子

function Foo() {
  this.a = 1;
  this.b = 2;
}
 
Foo.prototype.c = 3;
 
_.forInRight(new Foo, function(value, key) {
  console.log(key);
});
// => 输出 'c', 'b', 然后 'a', `_.forIn` 会输出 'a', 'b', 然后 'c'。

数组 Array

集合 Collection

日期 Date

函数 Function

Lang

数学 Math

数字 Number

对象 Object

Seq

字符串 String

实用函数 Util

Properties

Methods