Module 23 of 23 · Media
Make multiple requests at once
AC-5 Make multiple requests
Refactor your weather application, so the input field doesn't only accept a string value of a single city by a collection of cities that are comma separated. So for example, the user can write in the input field something like 'Milan, Athens, Hamburg, Berlin, Stockholm'.
You must take this data and find a way to create a new request to the openweathermap api for every city's name that comes after the ',' separator. That means that after all responses are back and parsed, you are going to see all 5 sections with the data that corresponds to each city.
Bonus: Instead of showing all the sections at the same time, try to make every section to appear after 0.4 seconds from the previous one.
Hint: Try to use async / await but don't forget that setTimeout functions accept callbacks, so maybe you want to wrap the whole setTimeout into a whole Promise Object. Then you can have the await keyword for it.
Good luck!
See the final result here if you want, type multiple cities with a '-' dash between them.