2 var $ = require('../internals/export');
3 var $reduce = require('../internals/array-reduce').left;
4 var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5 var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
7 var STRICT_METHOD = arrayMethodIsStrict('reduce');
8 var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
10 // `Array.prototype.reduce` method
11 // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
12 $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
13 reduce: function reduce(callbackfn /* , initialValue */) {
14 return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);