服务器

Array

Collection

Date

Function

Lang

Math

Number

Object

Seq

String

Util

Properties

Methods

    _.forOwn(object, iteratee=_.identity)

    迭代对象的自身枚举字符串键控属性并iteratee为每个属性调用。迭代器被调用三个参数:(value,key,object)。迭代器函数可以通过显式返回提前退出迭代false

    版本

    0.3.0

    参数
    1. object (Object):迭代的对象。
    2. [iteratee=_.identity] (Function):每次迭代调用的函数。
    返回

    (对象):返回object

    function Foo() {
      this.a = 1;
      this.b = 2;
    }
     
    Foo.prototype.c = 3;
     
    _.forOwn(new Foo, function(value, key) {
      console.log(key);
    });
    // => Logs 'a' then 'b' (iteration order is not guaranteed).
    Try in REPL