Chalkboard - v3.0.4
    Preparing search index...

    Function mean

    • Calculates the mean of an array.

      Parameters

      • arr: number[]

        The array

      • Optionaltype: "arithmetic" | "geometric" | "harmonic" = "arithmetic"

        The type of mean, which can be "arithmetic", "geometric", or "harmonic"

      Returns number

      const result = Chalkboard.stat.mean([1, 2, 4, 8], "geometric"); // Returns the geometric mean