Function average

  • Get the Average of all Numbers in an Array

    Parameters

    • input: number[]

    Returns number

    Example

    import { array } from "@rjweb/utils"

    const arr = [4, 65, 76, 90, 1, -3]

    array.average(arr) // 38.833333333333336

    Since

    1.4.5

    Supports

    nodejs, browser