Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Array find method] Find an object with specific properties #Javascript #ES6
const people = [
{ name: 'chris', username: 'chrisoncode' },
{ name: 'nick', username: 'whatnicktweets' },
{ name: 'holly', username: 'hollylawly' },
];
people.find(person => person.name === 'holly');
// output: { name: 'holly', username: 'hollylawly' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment