Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created September 6, 2018 13:26
Show Gist options
  • Save jordanhudgens/4ddaaf596bbaf3cb26cbf06348c47af9 to your computer and use it in GitHub Desktop.
Save jordanhudgens/4ddaaf596bbaf3cb26cbf06348c47af9 to your computer and use it in GitHub Desktop.
const userOne = {
firstName: "Kristine",
lastName: "Hudgens"
};
const userTwo = {
firstName: "Tiffany",
lastName: "Hudgens"
};
// Function expression
const fullName = function() {
return `${this.lastName}, ${this.firstName}`;
};
// Nope!
// const fullName = () => {
// return `${this.lastName}, ${this.firstName}`;
// };
const kristine = fullName.bind(userOne);
const tiffany = fullName.bind(userTwo);
kristine(); //?
tiffany(); //?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment