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

Function eachReverse

public/javascripts/require.js:68–77  ·  view source on GitHub ↗

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

(ary, func)

Source from the content-addressed store, hash-verified

66 * returns a true value, it will break out of the loop.
67 */
68 function eachReverse(ary, func) {
69 if (ary) {
70 var i;
71 for (i = ary.length - 1; i > -1; i -= 1) {
72 if (ary[i] && func(ary[i], i, ary)) {
73 break;
74 }
75 }
76 }
77 }
78
79 function hasProp(obj, prop) {
80 return hasOwn.call(obj, prop);

Callers 3

newContextFunction · 0.85
getInteractiveScriptFunction · 0.85
require.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected