Write a function named getHighestPaidEmployee
that receives 2 parameters:
employees
- an Array of objects representing employees of a company. Each has the following properties
name
- a string representing the name of the employeedepartmentId
- a string representing the ID of the department the employee works insalary
- a number representing the salary of the employee, per monthdepartmentId
- a string representing the ID of a department
The function should return the name of the employee with the highest salary in the specified department. If no employee exists in that department return undefined
.
employees
=departmentId
=