I have a pretty straight forward question, however I can't seem to find a solution for it anywhere...
Basically I would like to instantiate a new Javascript object, but the class name is a variable. In PHP the implementation is fairly straight forward new $className(). I have tried the following solution in Javascript, without luck:
window.onload=function(){
function obj(){
this.show = function(){
console.log('Hallo World');
}
}
var objs = ['obj'];
new objs[0]().show();
}
Does anyone know how to pull this off?