Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jordangarcia
Created June 21, 2019 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordangarcia/f7d8f8fd50cad9529df0aa534a79df38 to your computer and use it in GitHub Desktop.
Save jordangarcia/f7d8f8fd50cad9529df0aa534a79df38 to your computer and use it in GitHub Desktop.
function Person(name) {
this.name = name;
}
Person.prototype.introduce = function() {
console.log("Hello i'm " + this.name);
};
var jon = new Person('jon')
var jordan = new Person('jordan')
jon.introduce()
jordan.introduce()
var introduceJon = jon.introduce.bind(jon)
var introduceJon2 = Person.prototype.introduce.bind(jon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment