I know how to check to see if a property of the global context exists. Any variation of
if (typeof myFunction != 'undefined'){...}
but what if I don't know the name of the function? I think globally I could do this
if (typeof this['myFunction'] != 'undefined'){...}
but I don't know how to do that in a function like this
function load(functionName){
if (typeof GLOBALCONTEX[functionName] != 'undefined'){
GLOBALCONTEX[functionName](arg1 , arg2 , ...);
}
}
And I don't want to use try/catch as I have heard it is slow.