Tell us what’s happening:
When i check out the link:
it gives an example code of the rest parameter with n1, n2, n3
being replaced with …n
why doesn’t the same logic aplies to the lesson?
And can’t we use x, y z
to …z?
Things I tried to make any scense of it so far is:
As far as i understand it it replaces and stores the values
but is limited to only the ammouth of variables you have
a and b does not exceed this logic so thats not the problem
Your code so far
const sum = (...z) => {
return args.reduce((a, b) => a + b, 0);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
.
Challenge: Use the Rest Parameter with Function Parameters
Link to the challenge: