Skip to content

Instantly share code, notes, and snippets.

@GarrettS
Last active December 26, 2015 10:49
Show Gist options
  • Save GarrettS/7139364 to your computer and use it in GitHub Desktop.
Save GarrettS/7139364 to your computer and use it in GitHub Desktop.
Function.prototype.bind example.
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