Possible Duplicate:
Use of .apply() with 'new' operator. Is this possible?
I need to create a new insance of a class (new SomeClass()
), but the arguments I need to pass is an array. I know I can call functions with apply()
and pass the array of arguments as the second argument to apply
, but how can I do this when creating a new instance?