Created
September 3, 2019 19:08
-
-
Save moiz-frost/677f1a703eb575c8a46e8346144c2b89 to your computer and use it in GitHub Desktop.
Binding this context
This file contains hidden or 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
function printCar() { | |
console.log(this) | |
} | |
var car = { | |
speed: 240 | |
} | |
printCar = printCar.bind(car) | |
printCar() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment