Skip to content

Instantly share code, notes, and snippets.

@bttmly
Last active August 29, 2015 14:05
Show Gist options
  • Save bttmly/6ae31cd4796816910540 to your computer and use it in GitHub Desktop.
Save bttmly/6ae31cd4796816910540 to your computer and use it in GitHub Desktop.
function applyConstructor ( ctor, args ) {
var instance;
function C () {}
C.prototype = ctor.prototype;
var instance = new C();
ctor.apply( instance, args );
return instance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment