Asynchronous JavaScript and await
Asynchronous work lets the program do other work while waiting. A Promise represents a future outcome. await suspends the continuation of its async function, not the entire application.
A concrete example
Show loading, success and failure states separately for a network request. Independent requests can be awaited together; dependent requests must remain sequential.
const [user, tasks] = await Promise.all([loadUser(), loadTasks()]);Explain it yourself
How do you clear a loading indicator when a Promise rejects?
How to study this
Write your reasoning first. Check the original documentation, identify an assumption, then try a different example. Reading this page does not count as verified skill evidence.
Source and review
Original RealDeveloper explanation; last source check: .