Last active
February 18, 2021 23:40
-
-
Save jonathan-fielding/2adcb7286597966d8cb6237f6be695b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 fruits = [ | |
{ | |
id: 1, | |
name: 'apple' | |
}, | |
{ | |
id: 2, | |
name: 'banana' | |
}, | |
{ | |
id: 3, | |
name: 'orage' | |
} | |
]; | |
const apple = fruits.find((fruit) => fruit.id === 1); | |
console.log(apple) // Result { id: 1, name: 'apple' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment