2 var $ = require('../internals/export');
3 var $reduceRight = require('../internals/array-reduce').right;
4 var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5 var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
7 var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
8 // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
9 var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
11 // `Array.prototype.reduceRight` method
12 // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
13 $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
14 reduceRight: function reduceRight(callbackfn /* , initialValue */) {
15 return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);