How do we insert the object 1 to each object on Object 2 below so that each object will have the value from the first object , so the property from Object which are firstMileRange , secondMileRange and thirdMileRange will be replaced with the values from the Object 1.
Any idea guys would be much appreciated. Thanks.
#Object 1 – data or object to insert
[
{
"firstMileRange": 1,
"secondMileRange": 2,
"thirdMileRange": 3
}
]
#Object 2 – object to insert the data to
[
{
"id": 1521,
"demographicType": "Demos",
"demos": "Estimated Population",
"streetName": null,
"vehicleCount": null,
"firstMile": 100000,
"firstMileRange": null,
"secondMile": 50000,
"secondMileRange": null,
"thirdMile": 50000,
"thirdMileRange": null
},
{
"id": 1522,
"demographicType": "Demos",
"demos": "Households",
"streetName": null,
"vehicleCount": null,
"firstMile": 5999,
"firstMileRange": null,
"secondMile": 5999,
"secondMileRange": null,
"thirdMile": 5999,
"thirdMileRange": null
},
]
#expectedOutput
[
{
"id": 1521,
"demographicType": "Demos",
"demos": "Estimated Population",
"streetName": null,
"vehicleCount": null,
"firstMile": 100000,
"firstMileRange": 1,
"secondMile": 50000,
"secondMileRange": 2,
"thirdMile": 50000,
"thirdMileRange": 3
},
{
"id": 1522,
"demographicType": "Demos",
"demos": "Households",
"streetName": null,
"vehicleCount": null,
"firstMile": 5999,
"firstMileRange": 1,
"secondMile": 5999,
"secondMileRange": 2,
"thirdMile": 5999,
"thirdMileRange": 3,
},
]