Created
June 29, 2022 13:31
-
-
Save PaulRosset/92ad68f9c777d8b75cd89f386ed333f5 to your computer and use it in GitHub Desktop.
Javascript checking returns value from function
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 contacts = [ | |
{ address: "20B Rue Lafayette", name: "work" }, | |
{ address: "90B Rue laffite", name: "bar" } | |
]; | |
const contact = contacts.find(contact => contact.name === "home") | |
console.warn(contact) // undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment