Explorer
Node.js

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(); } ```

Chaining Array Methods

Easy
Write a function `processEmployees(employees)` that filters employees with salary > 50000, maps them to just their names, and sorts alphabetically.
Editor
Loading Editor...
Evaluate code
Output:Click "Run" above to execute and verify your code here.
["Bob","Charlie"]