Is there a way to achieve the following scenario:
var foo = function(){
this.value = 1;
}
var bar = "foo";
var baz = new bar();
alert(baz.value) // 1
Specifically, I am looking for a method to instantiate an object using its string name. Any suggestions?