Need private packages and team management tools?Check out npm Teams »

@extra-array/accumulate.min

2.8.34 • Public • Published

Produces accumulating values. 🏃 📼 📦 🌔 📒

Alternatives: accumulate, accumulate$.
Similar: map, filter, reduce, accumulate.
This is part of package extra-array.

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

array.accumulate(x, fn, [acc]);
// x:   an array
// fn:  reduce function (acc, v, i, x)
// acc: initial value
const array = require('extra-array');
 
var x = [1, 2, 3, 4];
array.accumulate(x, (acc, v) => acc+v);
// [ 1, 3, 6, 10 ]
 
array.accumulate(x, (acc, v) => acc+v, 100);
// [ 101, 103, 106, 110 ]

references

Install

npm i @extra-array/accumulate.min

DownloadsWeekly Downloads

692

Version

2.8.34

License

MIT

Unpacked Size

7.93 kB

Total Files

14

Last publish

Collaborators

  • avatar