Created
December 9, 2014 00:27
-
-
Save devdays/baf14ee0f55d8dbb9767 to your computer and use it in GitHub Desktop.
Object JavaScript - bind example
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
function sayHello(){ | |
alert(this.message); | |
} | |
var obj = { | |
message : "hello" | |
}; | |
setTimeout(sayHello.bind(obj), 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment