I'm updating an old project to now use requirejs. I have a method which dynamically calls other methods. Before, my App was registered in the global scope so the below code worked. Now that my App is now a module, window['App'] is undefined.
How can I check if an unknown method exists on my App module from within the module itself?
var App = {
run: function(name, args) {
if(typeof window['App'][name] == 'function') {
window['App'][name].apply(undefined, args);
}
}
}