The Employee class has a prototype that contains the setTitle and getTitle methods. The Engineer class has a prototype that contains the setIsManager and getIsManager methods.
function Employee(title) {
this.title = title;
}
Employee.prototype.setTitle = function (title) {
this.title = title;
};
Employee.prototype.getTitle = function () {
return this.title;
};
function Engineer(title, isManager) {
this.title = title;
this.isManager = isManager;
}
Engineer.prototype = Object.create(Employee.prototype);
Engineer.prototype.setIsManager = function (isManager) {
this.isManager = isManager;
};
Engineer.prototype.getIsManager = function () {
return this.isManager;
};