score:3

Accepted answer
const areas = [
  {name: 'Haram', condition: true, counter: 5}, 
  {name: 'Nasr City', condition: false, counter: 3}, 
  {name: 'Faisl', condition: true, counter: 7}
];

const newAreas = areas.map(({name}) => ({label: name, value: name}));

console.log(newAreas);

Related Query

More Query from same tag