I've got this code set and a json file called statistics.json but when I log the data it says data is not defined
Anyone knows how to solve this?
const showStatistics = function(){
fetch("../assets/statistics.json")
.then(res => res.json())
.then(data => {data.stats})
.catch(err => console.error(err));
console.log(data);
}
{data.stats}. What is that supposed to do?