I'm attempting to integrate the fetch method in order to showcase the latest weather information on a webpage. Despite my efforts, I consistently encounter an error indicating that 'res' is not defined. Can someone advise me on how to resolve this issue?
fetch('https://api.openweathermap.org/data').then(res => {
return res.json();
}).then(function(myJson) {
console.log(res.coord);
});
Disclaimer: The API request has been altered for privacy reasons