UNPKG

mdn-polyfills

Version:
2 lines (1 loc) 492 B
Array.prototype.reduce||Object.defineProperty(Array.prototype,"reduce",{value:function(e){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var r,t=Object(this),o=t.length>>>0,n=0;if(2<=arguments.length)r=arguments[1];else{for(;n<o&&!(n in t);)n++;if(o<=n)throw new TypeError("Reduce of empty array with no initial value");r=t[n++]}for(;n<o;)n in t&&(r=e(r,t[n],n,t)),n++;return r}});