I need to dynamically assign the name of a function to an element of an associative array. This is my attempt which does not work. The problem I am asking for help with is here
I would use window[] and make sure its a function before trying to execute it since you don't have control over what is passed.
var f = window[cr['cmd1']]; if(typeof f==='function') { f(x); }