* Creates a function for `_.forEach` or `_.forEachRight`. * * @private * @param {Function} arrayFunc The function to iterate over an array. * @param {Function} eachFunc The function to iterate over a collection. * @returns {Function} Returns the new each function.
(arrayFunc, eachFunc)
| 4894 | * @returns {Function} Returns the new each function. |
| 4895 | */ |
| 4896 | function createForEach(arrayFunc, eachFunc) { |
| 4897 | return function(collection, iteratee, thisArg) { |
| 4898 | return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) |
| 4899 | ? arrayFunc(collection, iteratee) |
| 4900 | : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); |
| 4901 | }; |
| 4902 | } |
| 4903 | |
| 4904 | /** |
| 4905 | * Creates a function for `_.forIn` or `_.forInRight`. |
no test coverage detected