1const things = {
2 thing: [
3 { place: 'here', name: 'stuff' },
4 { place: 'there', name: 'morestuff1' },
5 { place: 'there', name: 'morestuff2' },
6 ],
7};
8
9const removeDuplicates = (array, key) => {
10 return array.reduce((arr, item) => {
11 const removed = arr.filter(i => i[key] !== item[key]);
12 return [...removed, item];
13 }, []);
14};
15
16console.log(removeDuplicates(things.thing, 'place'));
17// > [{ place: 'here', name: 'stuff' }, { place: 'there', name: 'morestuff2' }]
18