how to find a object in array js code example
Example 1: javascript get array object by id
myArray.find(x => x.id === '45').foo;
Example 2: find object in array by property javascript
// Find an object with a given property in an array
const desiredObject = myArray.find(element => element.prop === desiredValue);