Last active
June 21, 2022 15:34
-
-
Save wbarcovsky/a514edf716c2a2e2fad78decf3f7dbd2 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