0

I am trying to call a function whose name is in a variable like this:
const funcNames = [
  "func1",
  "func2",
  "func3"
];

someElem.funcNames[0](someArg);

Here I want funcName's 0 index element to be the name of the function I want to call on someElem (with args)

I hope I was able to explain

and I have seen this but its not what I want.

Thanks

Unnat
  • 398
  • 2
  • 12

0 Answers0