Beginner5 min
Sum of an Array
Return the sum of all numbers in the input array. An empty array should return zero.
Your function
Implement solve(value, extra) in JavaScript. Return the answer; printing alone does not count as a result.
Examples
Input:
[[1,2,3]]Output:
6Input:
[[4,-2]]Output:
2Constraints
Input contains at most 1,000 values or characters. Numbers are finite integers. Inputs follow the structure shown in the examples.