Exercise 1: Promise.all vs. a Sequential for Loop for Five Ingredients — Possible Solution ==================================================================== WHAT Promise.all(expiring.map(...)) ACTUALLY DOES ------------------------------ Calling .map() over the five expiring items immediately starts all five lookupIngredient calls - each one's own fetch to TheMealDB begins right away, without waiting for any of the others to finish first. Promise.all then waits for all five of those already-in-flight requests to complete before continuing. The total time is roughly however long the single slowest of the five requests takes, since they're all happening at the same time. WHAT A SEQUENTIAL for LOOP WOULD DO INSTEAD ------------------------------ A for loop that awaits each call one at a time would start the second ingredient's request only after the first one has fully finished, the third only after the second finishes, and so on. The total time becomes roughly the sum of all five requests' individual durations, since only one is ever in flight at any given moment. THE CONCRETE DIFFERENCE ------------------------------ For five ingredients each taking, say, roughly 200ms, the concurrent Promise.all version finishes in around 200ms total, while the sequential version takes roughly 1000ms (five times as long) - a genuine, measurable difference in how quickly the user sees recipe suggestions. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that Promise.all starts every request immediately and waits only as long as the slowest one, while a sequential loop's total time scales with the sum of every request, and correctly quantifies the concrete difference this makes for multiple ingredients.