form-cheatsheet/js/polyfills/EcmaScript/Array.prototype.map.js

2 lines
369 B
JavaScript

Array.prototype.map=function(d,h){var f,e,a;if(!this)throw new TypeError(" this is null or not defined");var b=Object(this),g=b.length>>>0;if("function"!==typeof d)throw new TypeError(d+" is not a function");1<arguments.length&&(f=h);e=Array(g);for(a=0;a<g;){var c;a in b&&(c=b[a],c=d.call(f,c,a,b),e[a]=c);a++}return e};
//# sourceMappingURL=Array.prototype.map.js.map