const things = {
thing: [
{ id: '12345', name: 'First name' },
{ id: '12345', name: 'Second name' },
{ id: '34536', name: 'Third name' },
],
};
const RemoveDuplicates = (array, key) => {
return array.reduce((arr, item) => {
const removed = arr.filter(i => i[key] !== item[key]);
return [...removed, item];
}, []);
};
console.log(RemoveDuplicates(things.thing, 'id'));