score:2

Accepted answer
const objects = [
  {
    id: 'base1-1',
    name: 'object1',
    supertype: 'Pokémon',
    subtypes: ['Stage 2'],
    level: '42',
    hp: '80',
  },
  // ...
  {
    id: 'base1-100',
    name: 'object100',
    supertype: 'Pokémon',
    subtypes: ['Stage 4'],
    level: '42',
    hp: '80',
  },
];
const result = objects.map(({id, name}) => ({id, name}));
console.log(result);

score:2

const mappedArray = originalArray.map(({firstProp, secondProp, thirdPropd}) => ({
  firstProp,
  secondProp,
  thirdProp,
}));

Related Query

More Query from same tag