I have a json object named data like below

And I have a function denomination in a string like below

test is the name of the function I would like to call and pass it the json object data.
here is the test function:
test = function (data) {
alert('I am the test function');
}
I already try:
eval(func(data));
It doesn’t work.
Any idea?
Thanks.
While
eval()is one possible solution, it is AWFUL.Instead, interrogate the
windowto find the function you want and run it from there:Example fiddle
This assumes your function has global scope.