Created
November 9, 2019 22:41
-
-
Save bicknest/1db39db9d7581f6481b0cf440011c6c3 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
const fooProto = { | |
data: { | |
descriptor: 'bar' | |
}, | |
printDescriptor: () => console.log(this.data.descriptor), | |
}; | |
const foo1 = Object.create(fooProto); | |
const foo2 = Object.create(fooProto); | |
foo1.data = {descriptor: 'baz'}; | |
foo2.printDescriptor(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment