Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda