Trying to update the values in a map in javascript. Below is how my map looks like.
Data in Map :[{…}]
[{
accId: "001",
lineOfBusiness: "Protection",
name: "Ins",
plannedValue: 1200.18,
SellOutValue: 4115.85,
productGroup: "INS",
sesnId: "a2s",
subGroups: [{
accountId: "001",
brandName: "INS",
isLocked: true,
lineOfBusiness: "Ction",
name: "Ins",
portfolioId: "a34",
productGroup: "IDES",
recordId: "006",
seasonId: "a2s",
territoryId: "0MI",
unitOfMeasurement: "MXN"
}]
}]
Here i am trying to update the map values plannedValue
and SellOutValue
with the updated values in a new map. when i am executing the below code i am getting the error
set is not a function.
//Cloning the map and formatting the values
let map1 = {};
for(var i in incoming){
map1[i] = incoming[i]
map1[i].set('plannedValue',map1[i].plannedValue.toLocaleString())
map1[i].set('SellOutValue',map1[i].SellOutValue.toLocaleString())
}
console.log(map1);
can someone please help me on this