Having two objects key is same and wanted to map to a new object with same key append with _old and _new. below are the sample objects and the expected result is below. experts, please help :)
oldobj = [
{
AddressLine1: "ABC Old",
AddressLine2: "DEF Old",
AddressLine3: "GHI Old"
}
];
newobj = [
{
AddressLine1 : "ABC New",
AddressLine2 : "DEF New",
AddressLine3 : "GHI New"
}
];
Below obj has new and old obj, key is same with _new & _old. Wanted to map the value that .. _new with objnew(refer the object above) and _old value with objold(refer the object above)
mixobj=[
{
AddressLine1_new : "string",
AddressLine1_old : "string",
AddressLine2_new : "string",
AddressLine2_old : "string",
AddressLine3_new : "string",
AddressLine3_old : "string"
}
]
Result to be expected is
mixobj=[
{
AddressLine1_new : "ABC New",
AddressLine1_old : "ABC Old",
AddressLine2_new : "DEF New",
AddressLine2_old : "DEF Old",
AddressLine3_new : "GHI New",
AddressLine3_old : "GHI Old"
}
]