javascript get index of key in object code example
Example 1: indexOf by object key
var index = peoples.findIndex(p => p.attr1 == "john")
Example 2: js find index of object by value of property and return it's key
const index = Data.findIndex(item => item.name === 'John');