Function: sumAsync()
sumAsync(
asyncIterable
):Promise
<number
>
Returns a promise that resolves to the sum of the numbers of asyncIterable
.
Parameters
• asyncIterable: AsyncIterable
<number
, any
, any
>
Returns
Promise
<number
>
Example
console.log(await sumAsync(asAsync([1, 4, 6, 2])))
//=> 3