UNPKG

527 BJavaScriptView Raw
1'use strict';
2var $ = require('../internals/export');
3var $reduce = require('../internals/array-reduce').left;
4var sloppyArrayMethod = require('../internals/sloppy-array-method');
5
6// `Array.prototype.reduce` method
7// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
8$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, {
9 reduce: function reduce(callbackfn /* , initialValue */) {
10 return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
11 }
12});