Guest User

Untitled

a guest
May 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class Human {
  2. constructor() {
  3. this.gender = 'male';
  4. }
  5.  
  6. printGender() {
  7. console.log(this.gender);
  8. }
  9. }
  10.  
  11. class Person extends Human{
  12. constructor() {
  13. super();
  14. this.name = 'Brix';
  15. }
  16.  
  17. printMyName() {
  18. console.log(this.name);
  19. }
  20. }
  21.  
  22. const person = new Person();
  23. person.printMyName();
  24. person.printGender();
Add Comment
Please, Sign In to add comment