How do we implement the below code using Promise.all() ? I have tried using promise,async/await way. But, this problem requires something to be done using Promise.all()
class Provider{
/*
Gets the weather for a given city
*/
static getWeather(city){
return Promise.resolve(`The weather of ${city} is cloudy`)
};
/*
Gets the weather for a given city
*/
static getLocalCurrency(city){
return Promise.resolve(`The local currency of ${city} is GBP`)
};
/*
Gets the Longitude and Latitude, this function returns a city
*/
static findCity(long,lat){
return Promise.resolve(`London`)
};
};
//my implamentation;
let fnCall = async () => {
let city = await Provider.findCity(0.1278,51.5074);
let cityWeather = await Provider.getWeather(city);
let cityCurrency = await Provider.getLocalCurrency(city);
console.log(city);
console.log(cityWeather);
console.log(cityCurrency);
}
fnCall();