current_unit & current are Keys that contain the current weather data object.
fetch(urlWithParams, requestOptions)
.then(response => response.json()) // Convert the response to JSON
.then(data => {
// Extract the current weather data from the response
const weather = data.current;
console.log(weather);
Therefore this is why we use const weather = data.current; rather than const weather = data.current_temp
current_unit & current are Keys that contain the current weather data object.
Therefore this is why we use
const weather = data.current;
rather thanconst weather = data.current_temp