const data = [{id: 1, order_id: 1}, {id: 2, order_id: 1}, {id: 3, order_id: 2}] const duplicates = data.filter((item, index) => index !== data.findIndex((v) => v.order_id === item.order_id)); console.log(duplicates)