Complete the function
// returns the sum of all numbers in nums
function total(nums: number[]): number {
return nums.reduce((acc, n) => acc + n, ____);
}
// total([1,2,3]) -> 6
Answer: 0
The reduce seed must be 0 so the running total starts correctly.
Play Problem Solving ▸