sum = nums.reduce(function(accum, val) code example Example: reduce javascript let sum = arr.reduce((curr, index) => curr + index);