Time All-time Cases Recorded Deaths Active Cases
Country All-time Cases Recorded Deaths Active Cases

Hacks: Breaking Down the Code

Time All-time Cases Recorded Deaths Active Cases
Country All-time Cases Recorded Deaths Active Cases
  • This first part is a Table, Th is table header, and we can see that the table has 4 columns: “time” “all time cases “ “Recorded Deaths” and “Active cases”. td is the table data and it gives 4 IDs: time, total cases, total deaths, and active cases. Each ID stores the data that is fetched by dcoument.getElementByID (later in the code) for time, total cases, total deaths, and active cases. To make the world data table.
  • The country data table does the same process for the headers, however it has an ID “result” which is returned by the upcoming data.
  • Finally .catch(err =>{ catches every error in the code, and instead of breaking the whole code, it just tells you what the specific error is
  • If this was not here, then (if there was an error) the whole output would be blank.