1var idCounter = 1;
2
3function Employee(name, dept) {
4 this.name = name || '';
5 this.dept = dept || 'general';
6 this.id = idCounter++;
7}
8
9function Manager(name, dept, reports) {...}
10Manager.prototype = new Employee;
11
12function WorkerBee(name, dept, projs) {...}
13WorkerBee.prototype = new Employee;
14
15function Engineer(name, projs, mach) {...}
16Engineer.prototype = new WorkerBee;
17
18function SalesPerson(name, projs, quota) {...}
19SalesPerson.prototype = new WorkerBee;
20
21var mac = new Engineer('Wood, Mac');
22