* Write a function called sum that uses the reduce method to sum up an array of numbers. * Examples: ```javascript sum([1,2,3,4,5]); //returns 15 sum([6,7,7]); //returns 20 ```
Example: sum of number using reduce
console.log(
[1, 2, 3, 4].reduce((a, b) => a + b, 0)
)
console.log(
[].reduce((a, b) => a + b, 0)
)