Function sum

  • Computes the sum of the values in array.

    Parameters

    • array: number[]

      The array to iterate over.

    Returns number

    Returns the sum.

    3.4.0

    sum([4, 2, 8, 6])
    // => 20