Use the Rest Operator with Function Parameters Help

Tell us what’s happening:
Hey guys, This post is not about solving a problem with the code, sorry about that.

The thing is that I was having some trouble understanding the Rest Operator and then I saw this video of the freecodecamp youtube channel https://www.youtube.com/watch?v=iLx4ma8ZqvQ and it all came clear to me.

Maybe some of you already had this idea in mind, but I wanted to share it with you, just to be sure someone reads it and perhaps puts it to use. Here it goes:

-Why don’t you guys put videos or links to videos related to the contents of the challenge in the challenge page?

My only intention is to make this site better since it is really helping me improve my skills and that makes me happy! Great work!

Your code so far


const sum = (function() {
  "use strict";
  return function sum(...args) {
    
    return args.reduce((a, b) => a + b, 0);
  };
})();
console.log(sum(1, 2, 3)); // 6

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-the-rest-operator-with-function-parameters

I added set of [spoiler] ... [/spoiler] tags around your code. Please use them if you are going to give the answer.

As to linking videos… There is a “hint” link where you can get resources. And these things are findable with a google search.

Personally, I like that you have to seek out information. This is how devs work. As a professional dev, I have to consult the docs and google or Stack Overflow a couple times a day. If it’s a hard problem or a new library, it might be several times an hour. There are just too many libraries to learn them all and they keep changing. Knowing how to find the answer is an important skill. And your boss isn’t going to give you links to videos when he gives you an assignment. You’ll have to … read the docs and do so google searches and figure it out. This is good training. That’s my $.02 anyway.