Skip to content

Instantly share code, notes, and snippets.

@kopylovvlad
Created April 30, 2017 12:08
Show Gist options
  • Select an option

  • Save kopylovvlad/dc7037d0fee658335ba51828d9aa0432 to your computer and use it in GitHub Desktop.

Select an option

Save kopylovvlad/dc7037d0fee658335ba51828d9aa0432 to your computer and use it in GitHub Desktop.
'use strict'
class Animal {
constructor (name) {
this.name = name
}
walk () {
console.log(`${this.name} is walking`)
}
}
class Rabbit extends Animal {
walk () {
super.walk()
console.log("...and jumping!")
}
}
new Animal('John').walk()
new Rabbit('Bob').walk()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment