javascript find index of object in array by id code example Example: how to get the index of an array in javascript search = (arr, item) => { return arr.indexOf(item); }