API Reference

Reduces an array with an async function

function reduceAsync<T, V = any>(
  arr: T[],
  fn: (acc: any, i: T) => Promise<any>,
  defaultValue?: V
)

// Example:

await reduceAsync([1, 2, 3], asyncAdd) //=> 6