I am working with an array containing objects, each with a specific structure...
[{
user: { /* ... more (nested) user data ... */ },
vacation: {
id: 'idValue',
name: 'nameValue',
startDate: 'dateValue',
},
},...]
My goal is to restructure each object item to look like this...
{
user: { /* ... more (nested) user data ... */ },
id: 'idValue',
name: 'nameValue',
startDate: 'dateValue',
}
... meaning, the properties from the nested vacation
data should now be at the root level of the parent structure.
What would be the best approach to accomplish this task?