I need to store a function alongside with its parameters on an object, that is to say something like this:
function myFunction(params) {
console.log('Params',params);
}
const obj = {method: myFunction, params: [params]};
how can I construct this function and its parameters again in order to execute it from what I have in obj?
)(closing parenthesis) just before the;at the end ofconst obj = {method: myFunction, params: [params]);should be a}(closing curly brace).