Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Human {
- constructor() {
- this.gender = 'male';
- }
- printGender() {
- console.log(this.gender);
- }
- }
- class Person extends Human{
- constructor() {
- super();
- this.name = 'Brix';
- }
- printMyName() {
- console.log(this.name);
- }
- }
- const person = new Person();
- person.printMyName();
- person.printGender();
Add Comment
Please, Sign In to add comment