У меня есть 2 или несколько объектов в одной переменной, и я хочу поместить эти объекты в один объект.
let a = {"device_type":"iphone","filter_data":{"title":{"value":"Lorem Ipsum..","data":{}},"message":{"value":"Lorem Ipsum is simply dummy text of the printing...","data":{}},"dismiss_button":{"value":"Ok","data":{}},"action_url":{"value":"","data":{"type":"custom"}}}}
{"device_type":"iphone","filter_data":{"message":{"value":"Push Message goes here.","data":{}}}}
Я хочу вывод:
{
"0": {
"device_type": "iphone",
"filter_data": {
"title": {
"value": "Lorem Ipsum..",
"data": {}
},
"message": {
"value": "Lorem Ipsum is simply dummy text of the printing...",
"data": {}
},
"dismiss_button": {
"value": "Ok",
"data": {}
},
"action_url": {
"value": "",
"data": {
"type": "custom"
}
}
}
},
"1": {
"device_type": "iphone",
"filter_data": {
"message": {
"value": "Push Message goes here.",
"data": {}
}
}
}
}
Как я могу это сделать?