I have two arrays of objects like
a = [
{chargeType: "Accounting Charges", ct: 6, st: 6, it: 12},
{chargeType: "Commission", ct: 6, st: 6, it: 12},
{chargeType: "Processing Charges", ct: 6, st: 6, it: 12},
{chargeType: "Verification Charges", ct: 6, st: 6, it: 12},
{chargeType: "Application Fees", ct: 6, st: 6, it: 12},
{chargeType: "Legal Charges", ct: 6, st: 6, it: 12},
{chargeType: "Bank Charges", ct: 6, st: 6, it: 12},
]
and
b = [
{chargeType: "Accounting Charges", ct: 6, st: 6, it: 12},
{chargeType: "Commission", ct: 6, st: 6, it: 12},
{chargeType: "Processing Charges", ct: 7, st: 7, it: 14},
{chargeType: "Verification Charges", ct: 6, st: 6, it: 12},
{chargeType: "Application Fees", ct: 6, st: 6, it: 12},
{chargeType: "Legal Charges", ct: 6, st: 6, it: 12},
]
1.now by comparing both arrays If any charges missing in array b then add a boolean property in array a. like in array A bank charges record is there, but it's missing in array B. so, I have to add a property to that bank charges object in array A.
- in Array B if any record is updated those values should be copied in array A. like in array B proceesing charges record ct,st and it values are updated and those values should be updated in array A.
can anyone help how to achieve this