I apologize for my previous post. I have successfully integrated a RapidAPI for Covid-19 updates, which is now outputting the results as an array JSON in the console. You can view the YAML Array Output here. I am now facing a challenge in listing specific countries and their respective information from the JSON array using fetch and the inner HTML method. I attempted to achieve this with the code snippet:
document.getElementById('countryname').innerHTML = response.0.country;
Unfortunately, this resulted in an error. Each country is structured under its own table with numbers ranging from 0 to 232.
I then tried:
document.getElementById('countryname').innerHTML = response.country[0];
which led to an error stating "Cannot read property '0' of undefined.". Despite researching extensively for a solution, I have not been able to find one. It seems that even response.country on its own returns as undefined.