Last active
August 10, 2022 12:42
-
-
Save wbarcovsky/498f7b061af802c9c3c2dfa184b35534 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 Parent { | |
| constructor(params) { | |
| Object.assign(this, params); | |
| } | |
| static fabric() { | |
| return new Parent({ source: 'fabric', test: 1 }); | |
| } | |
| title() { | |
| return "I'm Parent"; | |
| } | |
| } | |
| class Children extends Parent { | |
| title() { | |
| return "I'm Children"; | |
| } | |
| } | |
| const parent = Parent.fabric(); | |
| const children = Children.fabric(); | |
| console.log(parent.title(), children.title()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment