function extend(Child, Parent) {
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Object.defineProperty(Child, "super", { "value": Parent.prototype })
function Employee4 (name, dept) {
console.log('Employee constructor')
this.dept = dept || "general";
Employee4.prototype.work = function() {console.log("Employee.work")}
Employee4.prototype.workAsEmployee = function() { this.work() }
function WorkerBee4 (projs) {
console.log('WorkerBee constructor')
this.projects = projs || [];
extend(WorkerBee4, Employee4);
WorkerBee4.prototype.work = function() {console.log("WorkerBee.work")}
WorkerBee4.prototype.workAsBee = function() { this.work() }
function Engineer4 (mach) {
console.log('Engineer constructor')
this.dept = "engineering";
this.machine = mach || "";
extend(Engineer4, WorkerBee4);
Engineer4.prototype.work = function() {console.log("Engineer.work")}
Engineer4.prototype.workAsEngineer = function() { this.work() }
console.log(Employee4.prototype.isPrototypeOf(e4))
console.log(WorkerBee4.prototype.isPrototypeOf(e4))