-
-
Save GarrettS/7139364 to your computer and use it in GitHub Desktop.
Function.prototype.bind example.
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
var couple = { m : "Garrett", f : "Tomomi" }; | |
var marriage = function() { console.log(this.f + " is married to " + this.m); }; | |
var status = marriage.bind(couple); | |
status(); | |
"Tomomi is married to Garrett"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment