Calculates the cumulative sum of an array.

  • Parameters

    • arr: number[]

      The array

    Returns number[]