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

Function _keyIterator

public/javascripts/async.js:134–152  ·  view source on GitHub ↗
(coll)

Source from the content-addressed store, hash-verified

132 };
133
134 function _keyIterator(coll) {
135 var i = -1;
136 var len;
137 var keys;
138 if (_isArrayLike(coll)) {
139 len = coll.length;
140 return function next() {
141 i++;
142 return i < len ? i : null;
143 };
144 } else {
145 keys = _keys(coll);
146 len = keys.length;
147 return function next() {
148 i++;
149 return i < len ? keys[i] : null;
150 };
151 }
152 }
153
154 // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
155 // This accumulates the arguments passed into an array, after a given index.

Callers 2

async.jsFile · 0.85
_eachOfLimitFunction · 0.85

Calls 1

_isArrayLikeFunction · 0.85

Tested by

no test coverage detected