Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created March 2, 2010 20:20
Show Gist options
  • Select an option

  • Save tim-smart/319875 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/319875 to your computer and use it in GitHub Desktop.
var Animal = (function () {
var youCantSeeMe = 123;
return function () {
this.butIcan = 2 * youCantSeeMe;
};
})();
Animal.prototype.test = function() {
return this.butIcan;
};
// Returns true
new Animal() instanceof Animal;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment