Created
December 21, 2018 17:13
-
-
Save chris-sev/4a976283c650a047f6ca1c5484cdd149 to your computer and use it in GitHub Desktop.
find() in array of objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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