Where should i start in the curriculum?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

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

Challenge: Use the Rest Parameter with Function Parameters

Link to the challenge:

So , where should i start in order to know things like for example “reduce”? Because I have almost zero chance to understand how to make this code without this method. Same thing happened in the first part “Basic JavaScript” , where I had to know , that you can use “If” inside another “If” , similar to “for” even thou “If” and “for” are quite different.
Love how it’s all explained on freecodecamp , but it makes me question too many things when “rare” situations like these two happen.

Hi @casualuser !

Welcome to the forum!

You are still going to use the reduce method.
The part you are going to change is here

What the lesson is trying to teach you, is that instead of creating this array and assigning it to the variable called args

You can actually delete that and instead use the rest parameter here const sum = (x, y, z).

Just like they did in the FCC example here

function howMany(...args) 

The es6 section can be a little confusing.
Don’t worry about not understanding everything right away.

Hope that helps!

Hi @casualuser ,
the ES6 section comes a bit ahead of its time. Just go by it slowly, learn what you can and mark the rest for later, when it will come up again and you will have better chance to understand it. Many of the methods there will come up far ahead and you wont need for now. I often looked back in the ES6 section to refresh my memory, or come back to an advanced method i just have the chance to use, but was unable to comprehend in the past.

Thank you for your time and for the answer. I thought, that it was my lack of understanding something , since almost every person with the same question already knows about reduce (same with “if”).

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