You can use bracket notation to fetch an object:
var items = {};
items.obj1 = {};
var type = 'obj1';
var myFunc = function(type){
var newObj = items[type]; //returns items.obj1
};
How can you do the same to dynamically create an object using constructor functions?
var Constructor1 = function() {};
var Constructor2 = function() {};
var type = 'Constructor2';
var myFunc = function(type){
var newObj = new type(); // how do you invoke either constructor?
};