Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

205
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda