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

202
Views
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
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!