Skip to content

Instantly share code, notes, and snippets.

@rclark
Last active December 23, 2015 06:59
Show Gist options
  • Save rclark/6597674 to your computer and use it in GitHub Desktop.
Save rclark/6597674 to your computer and use it in GitHub Desktop.
function MyThing() {
var theThing = new Thing();
theThing.privateMethod();
return theThing;
}
// Somewhere else...
var whatIWant = MyThing();
function MyThing() {
Thing.call(this);
this.privateMethod();
}
// Somewhere else...
var whatIWant = new MyThing();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment