Skip to content

Instantly share code, notes, and snippets.

@lightalloy
Created January 20, 2018 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightalloy/18ceed56e03c8a4d15fed8bb77767d4f to your computer and use it in GitHub Desktop.
Save lightalloy/18ceed56e03c8a4d15fed8bb77767d4f to your computer and use it in GitHub Desktop.
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