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

174
Visualizações
"Cannot read" error when trying to access Object's properties

I have this JS Object that contains 3 "thread" objects each with different values. I am trying to get the values from each of the threads. I am able to print the entire json object, but I can't print individual values from them?

My code: console.log(threadArray) returns this in console: (which is perfect) enter image description here

but when I try to replace "threadArray" with "threadArray[0].threads[0]["_id" to get the first thread's ID, it says it Cannot read unknown value.

Does anybody know why?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It's because the object called "threads" is the same as "threadArray[0]" because it IS the first element in the array. You are calling the same object twice. Instead of that log, try using this one:

console.log(threadArray[0]._id);

I hope this helps! I will stay tunned so that you can tell me if it worked

about 4 years ago · Juan Pablo Isaza Relatório
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