In JavaScript, I want to create an object instance (via the new operator), but pass an arbitrary number of arguments to the constructor. Is this possible?
new
A revised solution from @jordancpaul's answer.
var applyCtor = function(ctor, args) { var instance = new ctor(); ctor.prototype.constructor.apply(instance, args); return instance; };