Skip to content

Instantly share code, notes, and snippets.

@sirlancelot
Created April 8, 2014 18:35
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 sirlancelot/10168422 to your computer and use it in GitHub Desktop.
Save sirlancelot/10168422 to your computer and use it in GitHub Desktop.
var MultipleInstance = (function() {
var uid = 0;
function MultipleInstance() {
// Increment the ID and make it a read-only property
Object.defineProperty(this, "id", { __proto__: null, value: ++uid });
}
return MultipleInstance;
}());
MultipleInstance.prototype.whatever = function() {
console.log("Hello, I am instance " + this.id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment