|
function Employee (name, salary, mySupervisor)
{
this.name = name;
this.salary = salary;
this.supervisor = mySupervisor;
}
var boss = new Employee ("111", 200);
var manager = new Employee ("222", 50, boss);
var teamLeader = new Employee ("Rose", 50, boss);
alert (manager.supervisor.name + "is the supervisor of" + manager.name);
alert (manager.name + "\'s supervisor is" + manager.supervisor.name);
</ script> |
|