I am strugging to format the below array.
const arr = [
{
"id": 96,
"body": "Post on FB",
"smAccounts": [
{
"id": 1,
"name": "Test 1"
},
{
"id": 3,
"name": "Glem vital"
},
{
"id": 2,
"name": "Shiv"
}
]
},
{
"id": 96,
"body": "Post on FB",
"smAccounts": [
{
"id": 1,
"name": "Test 1"
},
{
"id": 3,
"name": "Glem vital"
},
{
"id": 2,
"name": "Shiv"
}
]
},
{
"id": 96,
"body": "Post on FB",
"smAccounts": [
{
"id": 1,
"name": "Test 1"
},
{
"id": 3,
"name": "Glem vital"
},
{
"id": 2,
"name": "Shiv"
}
],
}
];
I want OutPut in below format:
arr = [
{
"id": 96,
"body": "Post on FB",
"smAccounts":
{
"id": 1,
"name": "Test 1"
}
},
{
"id": 96,
"body": "Post on FB",
"smAccounts":
{
"id": 2,
"name": "Glem vital"
}
},
{
"id": 96,
"body": "Post on FB",
"smAccounts":
{
"id": 3,
"name": "Shiv"
}
}
];