📅  最后修改于: 2022-03-11 15:03:39.103000             🧑  作者: Mango
const removeDuplicates = (array: SomeType[]) =>
array.reduce((acc: SomeType[], item) => [...acc.filter(({ id }) => id !== item.id), item], []);