Solving ES6 and reduce operators

Tell us what’s happening:
Guys, I am in need of solving.
What kind of hind do you recommend me?

Your code so far


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

Your browser information:

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

Challenge: Use the Rest Parameter with Function Parameters

Link to the challenge:

I’d start by taking a look at the documentation for Array.prototype.reduce to make sure you understand how to implement it.

1 Like