Skip to content

Instantly share code, notes, and snippets.

@rclark
Last active December 23, 2015 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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