MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / createForEach

Function createForEach

lib/web/jshint.js:4896–4902  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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`.

Callers 1

runInContextFunction · 0.85

Calls 2

bindCallbackFunction · 0.85
isArrayFunction · 0.70

Tested by

no test coverage detected