Skip to content

Instantly share code, notes, and snippets.

@entombedvirus
Created November 3, 2008 22:14
Show Gist options
  • Save entombedvirus/22005 to your computer and use it in GitHub Desktop.
Save entombedvirus/22005 to your computer and use it in GitHub Desktop.
var Foo = function() {
this.bar = "hey";
this.print = function() {
console.log(this.bar);
};
}
Foo.new = function() {
var n = {};
n.constructor = this;
this.call(n);
return n;
}
Foo.new().print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment