Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Parent {
- constructor() {
- // if method exists (was implemented) in chain
- if (this.autoPlay) {
- this.autoPlay(); // execute from parent
- }
- }
- }
- class Child extends Parent {
- autoPlay() {
- console.log('Child');
- }
- }
- const child = new Child();
Add Comment
Please, Sign In to add comment