Load users at the same time
Use async/await and Promise.all to load several users at once.
intermediateJavaScript
The task
fakeFetch(id) pretends to load a user from a server: it returns a Promise that resolves after a short wait.
Inside main():
- Load users 1, 2 and 3 at the same time with
Promise.all(not one after another). - Print how many users were loaded.
- Print their average age.
Your output should be:
Loaded 3 users Average age: 20