I want to set up a manager with a handler object that provides a specific function for each request. Why is only syntax a) working in other sample code I saw syntax b)
a)
my.manager.requesthandler.create();
.
b)
my.manager.requesthandler [create]();
.
// my manager-modul
(function(){
my.manager = (function(){
var requesthandler = {
create: function () {
//do something
}
};
return {
requesthandler : requesthandler
};
})();
})();
my.manager.requesthandler.create();works then b should bemy.manager.requesthandler["create"]();