function Employee (name,dept) {
this.name = name || "";
this.dept = dept || "general";
}
function WorkerBee(name,dept,projs) {
Employee.call(this, name, dept)
this.projects = projs || [];
}
WorkerBee.prototype = new Employee;
function Engineer (name, projs, mach) {
WorkerBee.call(this, name, "engineering",projs)
this.machine = mach || "";
}
Engineer.prototype = new WorkerBee;
var jane = new Engineer("Doe, Jane", ["navigator", "javascript"], "belau");
Employee.prototype.specialty = "none";
function instanceOf(object, constructor) {
while (object != null) {
if (object == constructor.prototype)
return true;
object = object.__proto__;
}
return false;
}
// console.log(jane instanceof Engineer)
console.log(instanceOf(jane, Engineer))
// console.log(jane.__proto__)
console.log(jane)
console