MCPcopy Index your code
hub / github.com/jashkenas/underscore / each

Function each

underscore.js:1360–1374  ·  view source on GitHub ↗
(obj, iteratee, context)

Source from the content-addressed store, hash-verified

1358 // Handles raw objects in addition to array-likes. Treats all
1359 // sparse array-likes as if they were dense.
1360 function each(obj, iteratee, context) {
1361 iteratee = optimizeCb(iteratee, context);
1362 var i, length;
1363 if (isArrayLike(obj)) {
1364 for (i = 0, length = obj.length; i < length; i++) {
1365 iteratee(obj[i], i, obj);
1366 }
1367 } else {
1368 var _keys = keys(obj);
1369 for (i = 0, length = _keys.length; i < length; i++) {
1370 iteratee(obj[_keys[i]], _keys[i], obj);
1371 }
1372 }
1373 return obj;
1374 }
1375
1376 // Return the results of applying the iteratee to each element.
1377 function map(obj, iteratee, context) {

Callers 6

filterFunction · 0.70
maxFunction · 0.70
minFunction · 0.70
groupFunction · 0.70
mixinFunction · 0.70
underscore.jsFile · 0.70

Calls 3

optimizeCbFunction · 0.70
iterateeFunction · 0.70
keysFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…