Created
November 15, 2017 01:14
-
-
Save charpeni/58d9bf9c53f1a59f5bb231b9031d8f2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 B extends A { | |
handleClick = () => { | |
super.handleClick(); | |
console.log("B.handleClick"); | |
} | |
handleLongClick() { | |
super.handleLongClick(); | |
console.log("B.handleLongClick"); | |
} | |
} | |
console.log(B.prototype); | |
// A {constructor: ƒ, handleLongClick: ƒ} | |
console.log(B.prototype.__proto__); | |
// {constructor: ƒ, handleLongClick: ƒ} | |
new B().handleClick(); | |
// Uncaught TypeError: (intermediate value).handleClick is not a function | |
new B().handleLongClick(); | |
// A.handleLongClick | |
// B.handleLongClick |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment