//Design a class for employee which takes id and name in during construction of object and has a salary property //Design a class which is manager and can have department property class Employee{ constructor(id,name){ if(!id || !name){ throw new Error('Employee id and name are mandatory'); } this.id = id ; this.name = name ; } setSalary(salary){ this.salary = salary ; } getSalary(){ return this.salary; } getName(){ return this.name; } getId(){ return this.id; } } class Manager extends Employee{ setDepartment(name){ this.deapartment = name ; } getDepartment(){ return this.deapartment; } } const employee = new Employee(1,"Satya"); employee.setSalary(100); const manager = new Manager(2,'John'); manager.setDepartment('CS'); console.log(employee.getSalary()); console.log(manager);