Created
August 13, 2019 18:33
-
-
Save ppraksa/83215ee45019aa623b958b078e6abfcc 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 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