Skip to content

Instantly share code, notes, and snippets.

@fantactuka
Created October 13, 2010 15:23
Show Gist options
  • Save fantactuka/624256 to your computer and use it in GitHub Desktop.
Save fantactuka/624256 to your computer and use it in GitHub Desktop.
var applyToNew = function(Class, args) {
var F = function () {};
F.prototype = Class.prototype;
var f = new F();
Class.apply(f, args);
return f;
};
applyToNew(SomeClass, arrayOfArguments);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment