vbr
1
Tell us what’s happening:
tests are passing but iam getting error
Your code so far*
const sum = (...nums) => {
return nums.reduce((a, b) => a + b, 0);
};
console.log(sum(1,2,3));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
.
Challenge: Use the Rest Parameter with Function Parameters
Link to the challenge:
ilenia
2
Almost there, try reading really carefully this:
The sum
function should use the ...
rest parameter on the args
parameter.
vbr
3
Got it.
I have changed the variable name to nums that causes the problem, when use …args then it is fine.
Thank you