Problem

Return the sum of all elements in the array (use a loop).

Examples

  • arraySum([1, 2, 3]) -> 6
  • arraySum([]) -> 0
Compile and test (Ctrl+Enter)