Created
December 26, 2019 21:02
-
-
Save SrChach/77c7b5298533b42f1cf2ad5d36f3d64d to your computer and use it in GitHub Desktop.
JS snippets
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
// For searching into an array, by object property | |
let arr = [ | |
{ name:"string 1", value:"this", other: "that" }, | |
{ name:"string 2", value:"this", other: "that" } | |
]; | |
let obj = arr.find(o => o.name === 'string 1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment