I need to create a function with variable number of parameters using new Function() constructor. Something like this:
new Function()
args = [\'a\', \'b\']; bod
You can do this:
let args = '...args' let body = 'let [a, b] = args;return a + b' myFunc = new Function(args, body); console.log(myFunc(1, 2)) //3