No points yet today. Solve a task to be first.
10 points per task. You appear here once you log in.
Ten tasks from every level, one clock, a score you can share. One attempt a day free; Pro retakes any time.
Progress is saved in this browser. Create a free account to keep it everywhere.
Write sum(nums)
sum(nums)
Return the total of an array of numbers. An empty array totals 0. Numbers can be negative or have decimals.
0
Examples
sum([1, 2, 3])
6
sum([10, -4])
sum([])
Plus 5 hidden tests with edge cases. Their inputs stay hidden until you have tried twice.
Run tests to see each example and hidden test pass or fail. Each run stops after 3 seconds.