Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
JavaScript Map Update field values

I have a JavaScript Map that is created from an Object. How do I update the Map Field Value?

I created the Map like this:

 const MapQuoteLine = new Map();

if (lineModels.length) {
  lineModels.forEach(function(line) {
   
  MapQuoteLine.set(line.record['Name'], line.record);

 })
 };

It looks like this:

 {"QL-0502520" => Proxy}
 key: "QL-0502520"
 Value: Compatibility__c: "N"
 Configured_Part_Number__c: "ABCD"
 Disc_for_Approval__c: 0
 Host_Name__c: null

Later in the code I am looping through the Map and I want to update the Compatibility__c field value only. How can I only update the Compatibility__c value? If I do the below it adds another field of Compatibility__c within the Values.

 for (var [key, value] of MapQuoteLine.entries()) {
 
  value.Compatability__c = downgradeCompatability(value, record.Compatability__c)


 }


 {"QL-0502520" => Proxy}
 key: "QL-0502520"
 Value: Compatibility__c: "Y"
 Compatibility__c: "N"
 Configured_Part_Number__c: "ABCD"
 Disc_for_Approval__c: 0
 Host_Name__c: null
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!