String is as follows: "foo('argument1','argument2')"
How can I execute this function as javascript without using eval? I know you can use
window[func](arguments),
but the arguments are part of the string. I tried using regex but I'm not sure how to do it considering javascript doesn't have lookbehinds. Any suggestions?
evalis your only real option, but more info would help.window[func].apply(null, args).