I have a array as follows:
data = [
{
"data": {
"id":1,
"vol":"0.0"
"details":{
"ABC":"8.30",
"OFG":"13.85",
"SPG":"70.80"
}
}
},
{
"data": {
"id":2,
"vol":"1.0"
"details":{
"ABC":"3.30",
"OFG":"15.85",
"SPG":"70.80"
}
}
}
]
I want to make an arrays from above array such that data inside details object is every element comes outside. So in my final array there will not be details object. I just want to bring all attributes of details object with other object. So my final array will look something like this
data = [
{
"data": {
"id":1,
"vol":"0.0"
"ABC":"8.30",
"OFG":"13.85",
"SPG":"70.80"
}
},
{
"data": {
"id":1,
"vol":"0.0"
"ABC":"8.30",
"OFG":"13.85",
"SPG":"70.80"
}
}
];
How can I do that?