0.1.8 • Published 6 years ago

entries-reduce v0.1.8

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

entries-reduce

NOTE: entries-reduce was renamed to @extra-entries/reduce. NPM

Reduce entries to single value with accumulator and values, like Array.reduce().

const reduce = require('entries-reduce');
// reduce(<entries>, <reduce function>, [initial value], [begin=0], [end])
// - <reduce function>(<accumulator>, <value>, <key>, <entries>)
// -> <accumulator>

reduce([22, 338, 618].entries(), (acc, v) => acc+v);
// 978
reduce(new Set([74, 207, 281]).entries(), (acc, v, k, ent) => acc+v+k, 0);
// 1124
reduce(new Map().set('GIMPS', 'prime').entries(), (acc, v, k, ent) => acc+v+k, '!');
// '!primeGIMPS'
0.1.8

6 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago