Skip to content

Instantly share code, notes, and snippets.

@erockdotdev
Created May 9, 2017 15:00
Show Gist options
  • Save erockdotdev/c8256b0f962cb93e1e8e501a2d0adb8c to your computer and use it in GitHub Desktop.
Save erockdotdev/c8256b0f962cb93e1e8e501a2d0adb8c to your computer and use it in GitHub Desktop.
eric_sanchez_constructor
class Eric {
constructor(age, from, transportation){
this.age = age;
this.from = from;
this.transportation = transportation;
}
speak(){
console.log(`I love ${this.from}`)
}
opinions(){
console.log(`I think the ${this.transportation} is better than the MTA`)
}
}
let eric = new Eric (29,'Brooklyn','PATH train')
// console.log(eric)
// eric.speak()
eric.opinions()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment