MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / forOwn

Function forOwn

MathBox/mathbox-bundle.js:37228–37242  ·  view source on GitHub ↗
(collection, callback, thisArg)

Source from the content-addressed store, hash-verified

37226 * // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
37227 */
37228 var forOwn = function(collection, callback, thisArg) {
37229 var index, iterable = collection, result = iterable;
37230 if (!iterable) return result;
37231 if (!objectTypes[typeof iterable]) return result;
37232 callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);
37233 var ownIndex = -1,
37234 ownProps = objectTypes[typeof iterable] && keys(iterable),
37235 length = ownProps ? ownProps.length : 0;
37236
37237 while (++ownIndex < length) {
37238 index = ownProps[ownIndex];
37239 if (callback(iterable[index], index, collection) === false) return result;
37240 }
37241 return result
37242 };
37243
37244 /**
37245 * This method is like `_.forOwn` except that it iterates over elements

Callers 14

createAggregatorFunction · 0.85
findKeyFunction · 0.85
isEmptyFunction · 0.85
mapValuesFunction · 0.85
containsFunction · 0.85
everyFunction · 0.85
filterFunction · 0.85
findFunction · 0.85
forEachFunction · 0.85
forEachRightFunction · 0.85
mapFunction · 0.85
reduceFunction · 0.85

Calls 2

baseCreateCallbackFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected