I have a set of data, I want to build a new one with custom property name, the existing set of data has nested, that's also one of the reason why I need to normalize it to suite my own use.
says I have this existing set of data
[{
name:"abc",
company:{name:"abc company",age_of_company:1},
age: 19
}]
I want to build a new array of object where the property and nested level will be like this
[{
ceo_name:"abc",
company_name:"abc company",
age: 19
}]
I'm stuck
const newData = existingData.map(obj => (
//obj.company.name I don't know what to do here
)