(array: number[])
| 27 | * @returns The mean of the input array. |
| 28 | */ |
| 29 | export function mean(array: number[]): number { |
| 30 | try { |
| 31 | return ( |
| 32 | array.reduce((previous, current) => (current += previous)) / array.length |
| 33 | ); |
| 34 | } catch (e) { |
| 35 | return 0; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Calculates the standard deviation of an array of numbers. |
no outgoing calls
no test coverage detected