is it possible to do something like this without evil eval:
var str=\'MyClass\'; eval(\'new \'+str);
i just learned that there\'s Reflectio
You could try this:
var str = "MyClass"; var obj = new window[str];
Here's an example:
function MyClass() { console.log("constructor invoked"); } var s = "MyClass"; new window[s]; //logs "constructor invoked"