Variable: meanAsync()
const
meanAsync: (asyncIterable
) =>Promise
<number
>
Defined in: statistics.d.ts:217
Returns a promise that resolves to the mean of the numbers of
asyncIterable
.
Returns a promise that resolves to NaN
for an empty async iterable.
Parameters
asyncIterable
AsyncIterable
<number
>
Returns
Promise
<number
>
Example
console.log(await meanAsync(asAsync([1, 4, 6, 2])))
//=> 3.25
console.log(await meanAsync(emptyAsync))
//=> NaN
Since
v3.5.0