Created
January 10, 2016 13:54
-
-
Save yusk90/3c84599dd89095b1f407 to your computer and use it in GitHub Desktop.
Test
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 { | |
constructor(name) { | |
this.name = name; | |
} | |
getName() { | |
return this.name; | |
} | |
} | |
class Dog extends Animal { | |
constructor(name) { | |
super(name); | |
} | |
bark() { | |
return `Dog ${this.name} is barking`; | |
} | |
} | |
var dog = new Dog ('Aban'); | |
console.log(dog.getName() === 'Aban'); | |
console.log(dog.bark() === 'Dog Aban is barking'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment