in runtime i get this
Uncaught ReferenceError: MyBaseClass is not defined
Yes you can do that. The code you posted will work fine.
However I suspect in your actual code you have it split across multiple files and MyBaseClass
is not executed before the code for MyClass
.
Fix JavaScript ordering or use external modules to have the ordering determined by the module loader.