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

86
Views
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 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report

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 Report
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!