Created
January 20, 2018 10:59
-
-
Save lightalloy/18ceed56e03c8a4d15fed8bb77767d4f to your computer and use it in GitHub Desktop.
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 Car { | |
constructor(options) { | |
this.title = options.title; | |
} | |
drive(){ | |
return 'vroom ' + this.title; | |
} | |
} | |
class Uaz extends Car{ | |
constructor(options){ | |
super(options) | |
this.color = options.color | |
} | |
honk(){ | |
return 'beep '+this.color | |
} | |
} | |
const car = new Uaz({ color: 'green', title: 'uaz' }) | |
car.honk(); | |
car.drive(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment