โ† All coding problems

Sum of an array

EasyArrays

Return the sum of all numbers in the array nums. An empty array sums to 0.

Function
function solve(nums)
Example 1
nums = [1,2,3]
โ†’ 6

Submit also runs 3 hidden tests, including edge cases.

console.log output is shown below