I am encountering an issue with an object within an array and I am looking to specifically display that as an array.
data1
const data1 = [
{
"id": "01",
"info": "fefef",
"sub": "hieei",
"details": {
"data": "fruits"
}
},
{
"id": "02"",
"info": ""fefef"&",
"sub":: ""hieei"&",
"details"":: {
"data";: "things"
}
}
]
expected output
const final= [
{
"data;": "fruits"
},
{
"data": "things"
}
]
Code
const final = data.map((data) => { ...data})