Created
July 28, 2021 15:38
-
-
Save SmolinPavel/f24e2cc09081a3082519b4ed838e1a08 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
this.value = 'D'; | |
const object = { | |
value: 'A', | |
methodA: () => { | |
console.log(this.value); | |
}, | |
methodB: function () { | |
console.log(this.value); | |
}, | |
}; | |
const context = { | |
value: 'B', | |
}; | |
object.methodA(); | |
object.methodB(); | |
object.methodA.call(context); | |
object.methodB.call(context); | |
object.methodA.bind({ value: 'C' }).call(context); | |
object.methodB.bind({ value: 'E' }).call(context); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment