There was an error while loading. Please reload this page.
Reduce values of set to a single value.
Similar: map, reduce, filter, filterAt, reject, rejectAt.
function reduce(x, fr, acc?) // x: a map // fr: reduce function (acc, v, k, x) // acc: initial value
const map = require('extra-map'); var x = new Map([['a', 1], ['b', 2], ['c', 3], ['d', 4]]); map.reduce(x, (acc, v) => acc+v); // → 10 map.reduce(x, (acc, v) => acc+v, 100); // → 110