I have the following array of employees. I want to create a new array employeeNames
that has only the firstName and lastName properties. I believe I can do this with the map()
method but I'm not exactly sure how.
let employees = { firstName: 'Collin', lastName: 'Sexton', email: 'exampe@test.com', dob: '03/20/1986' ... }
Resulting array should look like:
employeeNames = { firstName: 'Collin', lastName: 'Sexton' }