ts-playground
    Preparing search index...

    Function arithmeticMean

    • Arithmetic mean (average) of all values in the array If the array is empty, it returns 0 or the defaultValue

      Parameters

      • values: number[]
      • OptionaldefaultValue: number

      Returns number

      average of all values

      import { average } from '@kitsuyui/mymath'
      average([1, 2, 3, 4]) // => 2.5