Created
May 9, 2017 15:00
-
-
Save erockdotdev/c8256b0f962cb93e1e8e501a2d0adb8c to your computer and use it in GitHub Desktop.
eric_sanchez_constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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