Created
March 15, 2017 17:17
-
-
Save billybonks/4650f770b7056c7e7cfa7a6e6404ceb9 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 BaseClass { | |
static baseMethod () { console.log("Hello from baseMethod"); } | |
} | |
class MyClass extends BaseClass { | |
constructor(props) { | |
super(props); | |
} | |
static Woo () { | |
console.log('i am wooo') | |
} | |
} | |
Object.assign(MyClass, BaseClass); | |
MyClass.baseMethod(); | |
MyClass.Woo(); | |
console.log(MyClass.prototype) | |
console.log(BaseClass.prototype) | |
function A(){} | |
A.prototype ={a:function(){}} | |
function B(){} | |
B.prototype ={b:function(){}} | |
Object.assign(A,B) | |
console.log(A.prototype) | |
console.log(B.prototype) | |
http://stackoverflow.com/questions/5441508/how-to-inherit-static-methods-from-base-class-in-javascript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment