Weather App in JavaScript
Build a weather application
IntermediateMini ProjectsExample 6 of 20
weather-app.js
1async function getWeather(city) {2 const response = await fetch(`https://api.weather.com/${city}`);3 const data = await response.json();4 return { temp: data.temp, condition: data.condition };5}
Output
// Weather data
What's going on
Weather App fetches and displays weather data.