Implement a function sum(num) that sums numbers by accepting a number and allows for repeated calling with more numbers until it is called without arguments.
The function should:
Examples
sum(1)(2)(3)(); // 6 sum(10)(20)(30)(40)(); // 100 sum(5)(); // 5
JavaScript Function
No test results yet
Click "Run" to execute tests