Async / Await
Le rêve
getCurrentCity()
.then(city => getWeatherInfo(city))
.then(weatherInfo => console.log(weatherInfo.temperature))
.catch(error => console.error(error));try {
const city = getCurrentCity();
const weatherInfo = getWeatherInfo(city);
console.log(weatherInfo.temperature);
}
catch (error) {
console.error(error);
}Fonctionnement d'Async / Await
Mis à jour