class Man {
constructor(name) {
this.name = name;
}
}
class Employee extends Man {
constructor(name, position) {
super(name);
this.position = position;
}
}
let employee = new Employee("Max", "booker");
console.log("name is", employee.name);
console.log("position is",
employee.position);
// *** previous version ***
function ManES5(name) {
this.name = name;
}
function EmployeeES5(name, position) {
ManES5.apply(this, arguments);
this.position = position;
}