the array
the object property name
object's value for the given property name
Optional
nonStrict: booleanby default test the value like "===", if nonStrict is true, will test like "=="
the found index, -1 if not found
const myObjects = [{
id: 1,
name: "Green"
}, {
id: 2,
name: "Red"
}, {
id: 3,
name: "Blue"
}]
// search for an object in the array that have attribute "name" equals to "red", and return its index position in the array
const objectIndex = JMap.Util.Array.findIndexByProperty(myObjects, "name", "Red")
console.log(`Object index: ${objectIndex}`)
// display message 'Object index: 1'
JMap.Util.Array.findIndexByProperty
Search for first element index in the given object array, for a given attribute name and value.