Having trouble with my code and a statistics.json file - it keeps saying data is not defined when I try to log it.
Any suggestions for solving this issue?
const showStatistics = function(){
fetch("../assets/statistics.json")
.then(res => res.json())
.then(data => {data.stats})
.catch(err => console.error(err));
console.log(data);
}