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

88
Vistas
ReactJS using 0 to access a nested JSon object

In ReactJS I have used Fetch() to get https://query2.finance.yahoo.com/v8/finance/chart/M6E=F and am now trying to access the nested item that is stored in the json object called "actualData". Due to it using "0" in the path, I cannot find a way to drill down in the following line...

console.log(actualData.chart.result.0.meta.currency);

The code above errors because of the "0". How do I include that "0" to access the "currency" element under "meta"?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try it with this: console.log(actualData.chart.result[0].meta.currency);

about 4 years ago · Juan Pablo Isaza Denunciar

0

the result is a array, so you should access data by index

actualData.chart.result[0].meta.currency
about 4 years ago · Juan Pablo Isaza Denunciar
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