function Employee(name, dept) {
this.name = name || "";
this.dept = dept || "general";
}
function WorkerBee(projs) {
this.projects = projs || [];
}
WorkerBee.prototype = Object.create( Employee.prototype );
function Engineer(mach) {
this.dept = "engineering";
this.mach = mach || "";
}
Engineer.prototype = Object.create(WorkerBee.prototype);
var jane = new Engineer("belau");
console.log( 'projects' in jane );
Trying to check if jane
inherited the projects
property.
Outputs false
. Why?