SyntaxFix
Write A Post
Hire A Developer
Questions
Use recursion
var sum = (arr) => arr.length === 1 ? arr[0] : arr.shift() + sum(arr); sum([1,2,3,4]) // 10