Created
April 8, 2014 18:35
-
-
Save sirlancelot/10168422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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