Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Person {
  2.   constructor(name) {
  3.     this.name = name;
  4.   }
  5. }
  6.  
  7. class PolitePerson extends Person {
  8.   constructor(name) {
  9.     this.greetColleagues(); // 🔴 This is disallowed, read below why
  10.     super(name);
  11.   }
  12.   greetColleagues() {
  13.     alert('Good morning folks!');
  14.   }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement