
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can create copy of a function by spreading function parameters. function outerFunction(passedFunction) { return newFunction(...params) { return passedFunction(...params); }; }
params is an array. Since you know all values in the array are numbers, you can turn it into a string with JSON.stringify().
In the outerFunction, you can declare a Map or Object. In the inner function you can avoid executing the passed function if the params have already been passed before.