I want to combine and add few objects into a new object.
let data = {}
let status = true
let res = [{
"quantity": 82,
"startDate": "2021-05-04T02:09:00Z",
"unit": "bpm"
},
{
"quantity": 79,
"startDate": "2021-05-09T02:09:00Z",
"unit": "bpm"
}
]
Expected output
data = {
"status" : true,
"res" : [{
"quantity": 82,
"startDate": "2021-05-04T02:09:00Z",
"unit": "bpm"
},
{
"quantity": 79,
"startDate": "2021-05-09T02:09:00Z",
"unit": "bpm"
}
]
}
I need to add "status" and "res" into "data" object.
How can i do this??
Any suggestion would be great!!