Is there a way to call a function from a string with the body of the function? I only have the parameter names and can pass parameters to the function.
I attempted it this specific way
function callFunction(body, paramNames, params) {
return new Function(paramNames, body)(params);
}
This solution seems to work for only one parameter. How can I modify it to handle multiple parameters?
Thank you for your help!