score:1

    let s = new Set();
    let newData =  data.filter(d => {
      if (!s.has(d.name)) {
        s.add(d.name);
        return d;
      }
    });

score:1

const data = [{name: "car1",id: 1,}, {name: "car1",id: 2,}, {name: "car2",id: 3,}];

const uniqueChoices = data.reduce((acc, choice) => {
  if (acc.some(item => item.name === choice.name) {
    return acc;
  }
  return [...acc, item]
}, []);

<SelectInput choices={uniqueChoices} />

Related Query

More Query from same tag