Check out the following code:
function Employee(name,dept){
this.name = name || "Dave";
this.dept = dept || "General";
console.log(this instanceof Manager);
}
function Manager(){
this.base = Employee;
this.base("Jack","CustpmDept");
this.projects = [];
}
var jane = new Manager();
console.log(jane.name);
In the example
console.log(this instanceof Manager);
returns true because when you call
this.base = Employee;
you are basically sending Manager's this to the Employee. this.name and this.dept are actually attached to the Manager.