I have array of map objects, want to update two properties of each object.
- accountId
- handlerId
Updated:
Here is how array of map objects looks:
data: {
COMP_011234567 NYWC-LLUVULylrqhqq5QkMTU: {
accountId: "1234567 "
accountKey: "COMP_011234567 "
accountName: "Test123 "
adjusterClaimType: "WC"
adjusterKey: "COMP_01WC-LLUVULylrqhqq5QkMTU"
assignmentRulesKey: "COMP_011234567 NYWC"
companyAdjusterId: 1111111
companyId: "COMP_01"
exception: false
handlerId: "-LLUVULylrqhqq5QkMTU"
key: "COMP_011234567 NYWC-LLUVULylrqhqq5QkMTU"
lineOfBusiness: "WC"
name: "WC Med Only Direct Without skills - All states"
selectedState: "NY"
tpa: "no"
tpaCompany: ""
}
}
I need to trim() accountId and handlerId.
// Already tried this apporach:
data.forEach(i => {
i.accountId = i.accountId.trim();
i.handlerId = i.handlerId.trim();
})

i. Please provide a runnable minimal reproducible exampleArrayfunctions on an object....not going to work