Description/Explanation is not related to the exercise

Tell us what’s happening:
So, I’m in this JS/ES6 lesson and i don’t see any correlation between the explanation and the actual task. Should it be re-redacted to explain a little bit more?

  **Your code so far**

const sum = (x, y, z) => {
const args = [x, y, z];
return args.reduce((a, b) => a + b, 0);
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Challenge: Use the Rest Parameter with Function Parameters

Link to the challenge:

Seems fine to me. Using the explanation, I can quickly determine what the task wants me to do and change the code accordingly to pass the tests. As in, I just did that in like a minute. Frankly I am more expirienced and propably struggled a bit more the first time around - but that’s to long ago to remember.

So I don’t see your problem.
Please solve the challenge first, then if you still think something is off, elaborate on what you THINK is missing or unrelated.
Or if you can’t solve the challenge, post the part of the explanation that you don’t understand.

The task is to use rest parameters but instead uses reduce, and there no clear explanation about rest nor reduce. Also, as you said, you are more experienced, keep in mind that most of us are just learning and we started not long ago

The challenge does not really have anything to do with reduce. They only want you to change the arguments to match how they changed the arguments list in the example. That’s it.

3 Likes

That’s what makes my head boom :sweat_smile: what with the rest thing and the ARGS and how are those related?
Sorry if it’s a stupid question, but I don’t really see the connection

1 Like
function howMany(...args)

The … is the ‘rest’ as in ‘the rest of the arguments’.

1 Like

LoL, so dumb of me, now I get it, I thought it was something like arr.rest(something)

1 Like

No worries, new stuff is confusing

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.