Use the Rest Operator with Function Parameters-HELP

Tell us what’s happening:

Hey everyone!!I didn’t do so much exercises and now i started again!Can you help with this?I have understand some of them but not everything adn this is the reason why i can’t solve it?Can someone explain it to me?

Your code so far


const product = (function() {
	"use strict";
	return function product(n1, n2, n3) {
		const args = [n1, n2, n3];
		return args.reduce((a, b) => a * b, 1);
	};
})();
console.log(product(2, 4, 6));//48

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36.

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

What is it that you understand? That is a good start to know how we can help you

I can’t understand why sum() is not defined and how to do it?!

Because the starting code has a sum function, so the tests use that function. Your code has a product function. Result is that sum is not defined

So what I should do?

Reset your code so that the sum function appears again, and you can try again solving the challenge

Do you understand what the rest operator does?