Skip to content

Instantly share code, notes, and snippets.

@ppraksa
Created August 13, 2019 18:33
Show Gist options
  • Save ppraksa/83215ee45019aa623b958b078e6abfcc to your computer and use it in GitHub Desktop.
Save ppraksa/83215ee45019aa623b958b078e6abfcc to your computer and use it in GitHub Desktop.
class Humanoid {
constructor(name) {
this.name = name;
}
say() {
console.log(this.name);
}
}
class Human extends Humanoid {
constructor(name) {
super(name);
}
say() {
Humanoid.prototype.say.call(this);
// this what a real super.say() is
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment