This commit is contained in:
Luke Pulverenti 2017-01-27 18:07:14 -05:00
parent 82bcca376f
commit 8a6884abef
494 changed files with 256 additions and 120180 deletions

View file

@ -1,25 +1 @@
if (!Array.prototype.filter) {
Array.prototype.filter = function (fun /*, thisp*/) {
"use strict";
if (this == null)
throw new TypeError();
var t = Object(this);
var len = t.length >>> 0;
if (typeof fun != "function")
throw new TypeError();
var res = [];
var thisp = arguments[1];
for (var i = 0; i < len; i++) {
if (i in t) {
var val = t[i]; // in case fun mutates this
if (fun.call(thisp, val, i, t))
res.push(val);
}
}
return res;
};
}
Array.prototype.filter||(Array.prototype.filter=function(fun){"use strict";if(null==this)throw new TypeError;var t=Object(this),len=t.length>>>0;if("function"!=typeof fun)throw new TypeError;for(var res=[],thisp=arguments[1],i=0;i<len;i++)if(i in t){var val=t[i];fun.call(thisp,val,i,t)&&res.push(val)}return res});