Guest User

Untitled

a guest
Dec 14th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. class Parent {
  2. constructor() {
  3. // if method exists (was implemented) in chain
  4. if (this.autoPlay) {
  5. this.autoPlay(); // execute from parent
  6. }
  7. }
  8. }
  9.  
  10. class Child extends Parent {
  11. autoPlay() {
  12. console.log('Child');
  13. }
  14. }
  15.  
  16. const child = new Child();
Add Comment
Please, Sign In to add comment