Question: Write a program to create a class called Staff that inherits the following class. The new class overrides the getter function to print that the

Write a program to create a class called Staff that inherits the following class. The new class overrides the getter function to print that the user is a staff member with the showUser() getter method. As example, if the user is John Doe, it prints John Doe is a staff member Make an object from the Staff class and call the getter function of the Staff class to print the above message. 0 point if not using inheritance.

class User{ constructor(firstName, lastName){ this.firstName = firstName; this.lastName = lastName; } //Adding a method. get showUser(){ return `${this.firstName} ${this.lastName} is a user`; } }

show its output as well

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!