i am calling two api at same time and getting below response in array1 and array2.at Now i wanted to merge all the object in one array
Below is my array1 and array2 response.
Const Array1 = [
{
"lineLossId": 1,
"dataSource": "DFOS",
"category": "Dressings",
"entryDetails": {
"month": "September",
"year": "2023"
},
"HrDbMonth": null
},
{
"lineLossId": 2,
"dataSource": "DFOS",
"entryDetails": {
"month": "August",
"year": "2023"
},
"HrDbMonth": null
}
];
const array2 = [
{
"lineLossId": 3,
"dataSource": "DFOS",
"category": "Dressings",
"entryDetails": {
"month": "August",
"year": 2023
},
"uom": "OOOUnits"
}
];
I am expecting all the response to be merge in one array with all objects and in sequential index key.
Below is my Expected output
Const array3 = [
{
"lineLossId": 1,
"dataSource": "DFOS",
"category": "Dressings",
"entryDetails": {
"month": "September",
"year": "2023"
},
"HrDbMonth": null
},
{
"lineLossId": 2,
"dataSource": "DFOS",
"entryDetails": {
"month": "August",
"year": "2023"
},
"HrDbMonth": null
},
{
"lineLossId": 3,
"dataSource": "DFOS",
"category": "Dressings",
"entryDetails": {
"month": "August",
"year": 2023
},
"uom": "OOOUnits"
}
];