// Why did await not wait? // Teaching excerpts; see the explanation and boundaries on the episode page. // Need an order? Wait after each file. for (const file of files) { await upload(file); } show("Upload complete"); // Independent files? Wait for the group. await Promise.all( files.map(file => upload(file)) ); show("Upload complete"); // Failure is not completion. try { await uploadAll(files); show("Upload complete"); } catch { show("Upload failed"); }