Skip to content

Instantly share code, notes, and snippets.

@adrianmarkperea
Created June 19, 2020 12:37
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 adrianmarkperea/91176bf5c263cc6b3c77d81279fddeec to your computer and use it in GitHub Desktop.
Save adrianmarkperea/91176bf5c263cc6b3c77d81279fddeec to your computer and use it in GitHub Desktop.
Person.prototype.sayHi = function() {
console.log(`Hi! I'm ${this.firstName}`);
}
// Note that we did not recreate the objects here
personA.sayHi(); // Hi! I'm Adrian
personB.sayHi(); // Hi! I'm Be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment