Skip to content

Instantly share code, notes, and snippets.

@allison-lara
Created June 12, 2017 21:58
Show Gist options
  • Save allison-lara/d9aff6a0a64495606330f82b2430acc4 to your computer and use it in GitHub Desktop.
Save allison-lara/d9aff6a0a64495606330f82b2430acc4 to your computer and use it in GitHub Desktop.
Foo = function() {
this.boop = function() { return "boop" }
}
// function () {
// this.boop = function() { return "boop" }
// }
a = new Foo()
// Foo {boop: function}
b = new Foo()
// Foo {boop: function}
a.boop()
// "boop"
b.boop()
// "boop"
a.boop = function () { return "beep" }
// function () { return "beep" }
a.boop()
// "beep"
b.boop()
// "boop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment