I have an array of strings which define class names. I would like to instantiate these classes using the string name. I have tried to use window but I haven't been able to do it.
The structure is
var objects = ['string1', 'string2'];
So the window would look like
window [
    objects [
        'string1',
        'string2'    
    ]
]
I have tried:
new window['objects'][0];
But that threw the string is not a func error.
Anyone know how to do this?
Thanks


windowis a reserved word in javascript, why are you using it?windowis definitely not a reserved word. Seems clear that OP is making reference to the global object,.