1 var toObject = require('./toObject');
4 * Creates a base function for `_.forIn` or `_.forInRight`.
7 * @param {boolean} [fromRight] Specify iterating from right to left.
8 * @returns {Function} Returns the new base function.
10 function createBaseFor(fromRight) {
11 return function(object, iteratee, keysFunc) {
12 var iterable = toObject(object),
13 props = keysFunc(object),
14 length = props.length,
15 index = fromRight ? length : -1;
17 while ((fromRight ? index-- : ++index < length)) {
18 var key = props[index];
19 if (iteratee(iterable[key], key, iterable) === false) {
27 module.exports = createBaseFor;