Skip to content

Instantly share code, notes, and snippets.

@kluu1
Last active March 20, 2020 02:44
Show Gist options
  • Select an option

  • Save kluu1/0c01176cdca0c3e128aceb79fdb75097 to your computer and use it in GitHub Desktop.

Select an option

Save kluu1/0c01176cdca0c3e128aceb79fdb75097 to your computer and use it in GitHub Desktop.
const employees = [
{ id: 2002, name: 'Jordan Lake' },
{ id: 2008, name: 'Barney Veers' },
{ id: 5738, name: 'Amber Lee' },
{ id: 8835, name: 'James Herring' }
];
const employeeIds = employees.map(employee => {
return employee.id;
});
console.log(employeeIds); // [2002, 2008, 5738, 8835]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment