Example 1 — Official: Own + Inherited
Prototype enumerable keys are visited too.
function Foo() {
this.a = 1;
this.b = 2;
}
Foo.prototype.c = 3;
var keys = [];
_.forIn(new Foo(), function (value, key) {
keys.push(key);
});
// → ["a", "b", "c"] How It Works
- Instance owns
aandb. - Prototype adds enumerable
c. - forIn visits all three string keys.
- Iteratee receives
(value, key, object)each time.

