findIndexById()

Finds the index of the item in the array that has an id property matching the provided id.
const items = [
    { id: 1, name: "Apple" },
    { id: 2, name: "Banana" },
    { id: 3, name: "Apple" },
]
items.findIndexById(2)