array find element by property code example
Example 1: js find element in array by property
var result = jsObjects.find(obj => {
return obj.b === 6
})
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);