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