function baseFlatten(array, depth, predicate, isStrict, result) {
      var index = -1,
          length = array.length;

      predicate || (predicate = isFlattenable);
      result || (result = []);

      while (++index < length) {
        var value = array[index];
        if (depth > 0 && predicate(value)) {
          if (depth > 1) {
            // Recursively flatten arrays (susceptible to call stack limits).
            baseFlatten(value, depth - 1, predicate, isStrict, result);
          } else {
            arrayPush(result, value);
          }
        } else if (!isStrict) {
          result[result.length] = value;
        }
      }
      return result;
    }
The base implementation of `baseForOwn` which iterates over `object`
properties returned by `keysFunc` and invokes `iteratee` for each property.
Iteratee functions may exit iteration early by explicitly returning `false`.

@private
@param {Object} object The object to iterate over.
@param {Function} iteratee The function invoked per iteration.
@param {Function} keysFunc The function to get the keys of `object`.
@returns {Object} Returns `object`.