Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function filterEmployees(arr, arg) {
- const input = JSON.parse(arr);
- const [name, value] = arg.split('-');
- const filterResult = input.filter((empl) => empl[name] === value);
- filterResult.forEach((epml, index) => {
- console.log(`${index}. ${epml.first_name} ${epml.last_name} - ${epml.email}`);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement