Created
March 27, 2016 16:32
-
-
Save raduGaspar/fdaa5240bed52ddbd04d 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 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