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

206
Vistas
cannot reference object key

I add a key to the object, when I log it on console it is there with the other 2 keys
But it is not recognized in object.keys() and I can't reference to it in any way,
it is the key states in equipmentObj
fetch('data/equipmentStateHistory.json')
.then(res => res.json())
.then(json => {
    for (let i = 0; i < json.length; i++){
        for(let j = 0; j < equipmentObj.length; j++){
            if(json[i].equipmentId === equipmentObj[j].equipmentId){
                 
                **equipmentObj[j].states = json[i].states;**
                /* console.log(json[i].states) */
                /* Object.assign(equipmentObj, {key3: json[i].states}); */
            }
        }
    }
})

Here is the console with the two keys recognized
under is states as the 3rd key, which i cannot reference to use in the code
console_img

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