const aaa = [ {id: 10, val: "xx"}, {id: 27, val: "tr"}, {id: 13, val: "ut"} ] const index = aaa.findIndex(item => item.id === 27) console.log(index)