About “Use the Rest Operator with Function Parameters”

Tell us what’s happening:
I dunno, I’m stuck.

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Version/12.2 Safari/604.1 AlohaBrowser/2.8.2b4.

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

So I just went and did this. The test is expecting you to use args and not n.

You are also suppose to return the sum, not multiply each number to the results of the previous.

The challenge wants you to sum the numbers. You are multiplying the numbers.