Skip to content

Instantly share code, notes, and snippets.

@raduGaspar
Created March 27, 2016 16:32
Show Gist options
  • Save raduGaspar/fdaa5240bed52ddbd04d to your computer and use it in GitHub Desktop.
Save raduGaspar/fdaa5240bed52ddbd04d to your computer and use it in GitHub Desktop.
class Animal {
swim() {
console.log('swimming');
}
eat() {
console.log('eating');
}
sleep() {
console.log('sleeping');
}
}
class Duck extends Animal {
quack() {
console.log('quacking');
}
fly() {
console.log('flying');
}
}
class Chicken extends Animal {
cluck() {
console.log('clucking')
}
}
var d = new Duck();
d.fly();
d.sleep();
var c = new Chicken();
c.cluck();
c.sleep();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment