I have a JS class that takes in several arguments:
var MyClassName = function(arg1, arg2, arg3){
// Do stuff
};
I have a String that represents the class's name, and an array of arguments.
var class = "MyClassName"
var args = ["1", "2", "3"]
Using the String of the class name and the array of arguments, how can I instantiate the class? Prototype Bind/apply seems to have some relevance, but I can't quite figure out how this all works together. I've also tried using window["MyClassName"], but that throws an undefined error. Any suggestions?