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/