JSFiddle - React, Tailwind, and code Playground
by David Santiago
JavaScript
const yourArray = {issues:[
{ id: 1, test:123, received: 'value1' },
{ id: 2, received: 'value2', nested: {tst:123} },
{ id: 3 },
// Other objects...
]};
// Removing the 'received' field from each object in the array
const newArray = yourArray.issues.map(obj => {
const { received, ...rest } = obj;
return rest;
});
console.log(newArray);
// Removing the 'received' field from each object in the array
const newArray1 = yourArray.issues.map(obj => {
delete obj.received;
return obj;
});
console.log(newArray1);