MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / each

Function each

public/javascripts/require.js:53–62  ·  view source on GitHub ↗

* Helper function for iterating over an array. If the func returns * a true value, it will break out of the loop.

(ary, func)

Source from the content-addressed store, hash-verified

51 * a true value, it will break out of the loop.
52 */
53 function each(ary, func) {
54 if (ary) {
55 var i;
56 for (i = 0; i < ary.length; i += 1) {
57 if (ary[i] && func(ary[i], i, ary)) {
58 break;
59 }
60 }
61 }
62 }
63
64 /**
65 * Helper function for iterating over an array backwards. If the func

Callers 8

eachWithIndexFunction · 0.85
getGlobalFunction · 0.85
removeScriptFunction · 0.85
onErrorFunction · 0.85
breakCycleFunction · 0.85
checkLoadedFunction · 0.85
newContextFunction · 0.85
require.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected