find object with same id in an array javascript code example Example: javascript find object in array myArray.findIndex(x => x.id === '45');