Created
December 29, 2017 03:01
-
-
Save Storyyeller/7f4c1663df3e9c14540708d14bacfa1f 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 A { | |
foo() {return 'foo in A';} | |
} | |
class B extends A { | |
foo() {return 'foo in B';} | |
} | |
class C { | |
foo() {return 'foo in C';} | |
} | |
class D extends C { | |
foo() {return super.foo();} | |
} | |
b = new B; | |
console.log(b.foo()); // foo in B | |
B.prototype.foo = D.prototype.foo | |
console.log(b.foo()); // foo in C | |
console.log(b instanceof C); // false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment