1 var baseFor = require('./_baseFor'),
2 keysIn = require('./keysIn'),
3 toFunction = require('./_toFunction');
6 * Iterates over own and inherited enumerable properties of an object invoking
7 * `iteratee` for each property. The iteratee is invoked with three arguments:
8 * (value, key, object). Iteratee functions may exit iteration early by explicitly
14 * @param {Object} object The object to iterate over.
15 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16 * @returns {Object} Returns `object`.
24 * Foo.prototype.c = 3;
26 * _.forIn(new Foo, function(value, key) {
29 * // => logs 'a', 'b', then 'c' (iteration order is not guaranteed)
31 function forIn(object, iteratee) {
32 return object == null ? object : baseFor(object, toFunction(iteratee), keysIn);
35 module.exports = forIn;