Write a function `processEmployees(employees)` that filters employees with salary > 50000, maps them to just their names, and sorts alphabetically.
Problem Statement
Write a function `processEmployees(employees)` that filters employees with salary > 50000, maps them to just their names, and sorts alphabetically.
Complexity
Time Complexity: -
Space Complexity: -
Hints
š” Hint 1:
Chain .filter().map().sort() for a pipeline approach.
š” Hint 2:
Filter by salary, map to name, sort with localeCompare or default.
š” Hint 3:
return employees.filter(e => e.salary > 50000).map(e => e.name).sort();
ā
Solution:
```javascript
function processEmployees(employees) {
return employees.filter(e => e.salary > 50000).map(e => e.name).sort();
}
```