Skip to content

Instantly share code, notes, and snippets.

@urielhdz
Created September 12, 2017 19:48
Show Gist options
  • Save urielhdz/ee108cabed077a6397c17d8b68db28dc to your computer and use it in GitHub Desktop.
Save urielhdz/ee108cabed077a6397c17d8b68db28dc to your computer and use it in GitHub Desktop.
class Human{
constructor(name,lastName){
this.name = name;
this.lastName = lastName;
//Asignamos el objeto actual como valor del contexto, y no cambiará
this.fullName = this.fullName.bind(this);
}
fullName(){
return this.name + this.lastName;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment