I am trying to parse JSON with JS, there is a array and is not working as intended. I have other API's in my program that i have parced. Here is the data
{
"cases": {
"6/5/20": 6774904,
"6/6/20": 6901877,
"6/7/20": 7015312,
"6/8/20": 7119002,
"6/9/20": 7236054
},
"deaths": {
"6/5/20": 396204,
"6/6/20": 400051,
"6/7/20": 402792,
"6/8/20": 406543,
"6/9/20": 411436
},
"recovered": {
"6/5/20": 2961441,
"6/6/20": 3032630,
"6/7/20": 3087135,
"6/8/20": 3238065,
"6/9/20": 3319551
}
}
The code that I am using for this is here.
const response = await fetch("https://disease.sh/v2/historical/all?lastdays=5");
const data = await response.json();
var casesH = data.cases[0];
msg.channel.send(casesH);
console.log(casesH);
Does anyone know what I could be doing wrong or what to do?
Thanks