the array
the object property name
object's value for the given property name
the found object, undefined if not found
const myObjects = [{
id: 1,
name: "Green"
}, {
id: 2,
name: "Red"
}, {
id: 3,
name: "Blue"
}]
// search for an object in the given array, having attribute "name" equals to "red", and returns found object or undefined
const foundObject = JMap.Util.Array.findByProperty(myObjects, "name", "Red")
console.log(`Found object: "${JSON.parse(foundObject)}"`)
// display message 'Found object: "{ \"id\": 2, \"name\": \"Red\" }"'
JMap.Util.Array.findByProperty
Search for first element in the given object array, for a given attribute name and value.