1 | ;
|
2 | var $ = require('../internals/export');
|
3 | var $reduce = require('../internals/array-reduce').left;
|
4 | var 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 | });
|