Skip to content

Instantly share code, notes, and snippets.

@calvimor
Last active September 20, 2016 13:30
Show Gist options
  • Save calvimor/dc8f024716942ebd9a82aa4e5d1391aa to your computer and use it in GitHub Desktop.
Save calvimor/dc8f024716942ebd9a82aa4e5d1391aa to your computer and use it in GitHub Desktop.
'use strict';
class Animal {
constructor (voice) {
this.voice = voice || 'Grunt';
}
speak() {
return this.voice;
}
}
class Cat extends Animal {
constructor (name, color) {
super('Meow');
this.name = name;
this.color = color;
}
}
var fluffy = new Cat('Fluffy', 'White');
console.log(fluffy.speaK());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment