UNPKG

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