MCPcopy Create free account
hub / github.com/developit/asyncro / reduce

Function reduce

src/index.js:25–30  ·  view source on GitHub ↗
(array, reducer, accumulator)

Source from the content-addressed store, hash-verified

23 * );
24 */
25export async function reduce(array, reducer, accumulator) {
26 for (let i=0; i<array.length; i++) {
27 accumulator = await reducer(accumulator, array[i], i, array);
28 }
29 return accumulator;
30}
31
32
33/** Invoke an async transform function on each item in the given Array **in parallel**,

Callers 1

seriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…