Trying to pull JSON values from here: https://covid-19api.com/api/all-today
However, the first item is cast as a string as opposed to an int. This is my testing code so far, I'm not sure how to cast the item as an int rather than a string.
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("https://covid-19api.com/api/all-today", requestOptions)
.then(response => response.json())
.then(result => {
let nconf = result.confirmed;
document.getElementById('nconf').innerHTML = nconf.toLocaleString('en');
let ndeath = result.deaths;
document.getElementById('ndeath').innerHTML = ndeath.toLocaleString('en');
let nrecov = result.recovered;
document.getElementById('nrecov').innerHTML = nrecov.toLocaleString('en');
})
.catch(error => console.log('error', error));