How can I find and execute a function inside of an object based on a string parameter?
see the following example:
var parameters = 'people';
switch (parameters) {
case 'people':
people.initialize();
break;
}
How can I remove the switch case statement in this scenario? Is it possible to call an object just by knowing the string name of the object?
Organize your objects…
If you are playing with globals (don’t play with globals) then you can get away with:
… but organizing them in logical objects is a better bet.