Skip to content

Instantly share code, notes, and snippets.

@normanzb
Created April 5, 2019 16:31
Show Gist options
  • Save normanzb/bf908b2ddab508e7c327e59500da8d0a to your computer and use it in GitHub Desktop.
Save normanzb/bf908b2ddab508e7c327e59500da8d0a to your computer and use it in GitHub Desktop.
function Ctor() {
}
Ctor.prototype.data = {counter: 0}
Ctor.prototype.bump = function() {this.data.counter++;}
a = new Ctor()
b = new Ctor()
a.bump();
console.log(a.data.counter)
console.log(b.data.counter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment