Arithmetic mean (average) of all values in the array If the array is empty, it returns 0 or the defaultValue
import { average } from '@kitsuyui/mymath'average([1, 2, 3, 4]) // => 2.5 Copy
import { average } from '@kitsuyui/mymath'average([1, 2, 3, 4]) // => 2.5
Optional
average of all values
Arithmetic mean (average) of all values in the array If the array is empty, it returns 0 or the defaultValue
Example