I am having a problem when trying to call a function which has it's name stored in a variable. I have found some questions regarding my problem on stackOverflow but still, I can't seem to resolve my problem. From what i understood, using
window[functionName]();
should call the function I want. I created a jsfiddle that I hope will clarify my problem. The problem is, that instead of my function being called I get an error:
window[functionName] is not a function
I believe there is some small thing I am missing, but after a long time spent trying to figure out what the problem was, I decided to give it a try here too.