Skip to content

Instantly share code, notes, and snippets.

@ctsstc
Created April 21, 2018 05:33
Show Gist options
  • Save ctsstc/dd39345e611a52b2579fa0b379d972c8 to your computer and use it in GitHub Desktop.
Save ctsstc/dd39345e611a52b2579fa0b379d972c8 to your computer and use it in GitHub Desktop.
class Animal {
static emote() {
let className = this.name;//this.constructor.name;
debugger
let emote = className == 'Animal' ? 'Cannot call emote() directly from Animal class' : `${className} does not implement execute()`;
console.log(emote);
return emote;
}
}
class Cat extends Animal {
static get namee() { return 'Catz'; }
static emote() {
return `meow i am ${super.name}`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment