MCPcopy
hub / github.com/quirkey/sammy / filter

Function filter

examples/backend/public/javascripts/jquery.cloudkit.js:235–251  ·  view source on GitHub ↗
(arr, fun /*, thisp*/)

Source from the content-addressed store, hash-verified

233 }
234
235 function filter(arr, fun /*, thisp*/){
236 var len = arr.length;
237 if (typeof fun != "function")
238 throw new TypeError();
239
240 var res = new Array();
241 var thisp = arguments[2];
242 for (var i = 0; i < len; i++) {
243 if (i in arr) {
244 var val = arr[i]; // in case fun mutates this
245 if (fun.call(thisp, val, i, arr))
246 res.push(val);
247 }
248 }
249
250 return res;
251 };
252
253 function slice(obj,start,end,step){
254 // handles slice operations: [3:6:2]

Callers 2

jquery.jsFile · 0.85
walkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected