I got a fetch call that return 100+ objects in an array. Each object got about 10 properties. I want to keep only 3 properties.
Example of returned JSON:
[
{
id: 'base1-1',
name: 'object1',
supertype: 'Pokémon',
subtypes: ['Stage 2'],
level: '42',
hp: '80',
},
.
.
//Another 100 objects like that
.
.
{
id: 'base1-100',
name: 'object100',
supertype: 'Pokémon',
subtypes: ['Stage 4'],
level: '42',
hp: '80',
},
];
I am using React.useState to set this array of objects into an array (cards) buy I don't want to save all these props inside each object. I only want name, and id. How to discard the rest?