Skip to content

Instantly share code, notes, and snippets.

@SrChach
Created December 26, 2019 21:02
Show Gist options
  • Save SrChach/77c7b5298533b42f1cf2ad5d36f3d64d to your computer and use it in GitHub Desktop.
Save SrChach/77c7b5298533b42f1cf2ad5d36f3d64d to your computer and use it in GitHub Desktop.
JS snippets
// 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