Course · Section 11: Working With Arrays · Lecture 149: Simple Array Methods
Implement `sum(arr)` that returns the sum of all numbers in `arr`. Return `0` for an empty array.
+ 2 hidden tests run on Submit.
reduce with an initial 0 sums every element, returning 0 for an empty array.
Run your code to see results.