varisArrayLike=require('./isArrayLike');/** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */functioncreateBaseEach(eachFunc,fromRight){returnfunction(collection,iteratee){if(collection==null){returncollection;}if(!isArrayLike(collection)){returneachFunc(collection,iteratee);}varlength=collection.length,index=fromRight?length:-1,iterable=Object(collection);while((fromRight?index--:++index<length)){if(iteratee(iterable[index],index,iterable)===false){break;}}returncollection;};}module.exports=createBaseEach;