Calculates the sum of all elements in an array.

  • Parameters

    • arr: number[]

      The array

    Returns number