Skip to content

Instantly share code, notes, and snippets.

@yusk90
Created January 10, 2016 13:54
Show Gist options
  • Save yusk90/3c84599dd89095b1f407 to your computer and use it in GitHub Desktop.
Save yusk90/3c84599dd89095b1f407 to your computer and use it in GitHub Desktop.
Test
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