@extra-array/reduce-right.min

Reduces values from right, to a single value.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-array/reduce-right.min
1402.10.197 months ago2 years agoMinified + gzip package size for @extra-array/reduce-right.min in KB

Readme

Reduces values from right, to a single value. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Alternatives: reduce, reduceRight.
Similar: map, filter, reject, reduce, accumulate.

This is part of package extra-array.

This is browserified, minified version of @extra-array/reduce-right.
It is exported as global variable arrayreduceRight.
CDN: unpkg
, jsDelivr.



array.reduceRight(x, fr, [acc]);
// x:   an array
// fr:  reduce function (acc, v, i, x)
// acc: initial value

const array = require("extra-array");

var x = [1, 2, 3, 4];
array.reduceRight(x, (acc, v) => acc+v);
// 10

array.reduceRight(x, (acc, v) => acc+v, 100);
// 110



References