Skip to content

Instantly share code, notes, and snippets.

@jlsjonas
Created January 30, 2017 16:49
Show Gist options
  • Select an option

  • Save jlsjonas/22bd9bdcc6ac6a62cea270e8e9ba218d to your computer and use it in GitHub Desktop.

Select an option

Save jlsjonas/22bd9bdcc6ac6a62cea270e8e9ba218d to your computer and use it in GitHub Desktop.
Presentation
class Person {
constructor(name, surname){
this.name = name;
this.surname = surname;
}
about(){
console.log(`Hello my name is ${this.name} ${this.surname}`);
}
get name(){ return this.name }
set name(newName){ this.name = newName }
}
const person = new Person('John','Doe')
person.name //John
person.name = ('Jane')
person.name //Jane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment