The preceding rehearsal demo awaited a cue. Build a different broadcast message and division guard. An async function always returns a Promise: returning a / b fulfills it; throw new Error("Division by zero") rejects it. A caller can await a fulfillment and catch a rejection. The single script.js tab runs in an offline preview and captures delayed Console logs.
A different delayed value can be awaited before changing its text:
async function readLabel() {
const label = await Promise.resolve("garden");
return label.toUpperCase();
}
readLabel().then(console.log); // GARDEN
delay(ms, value) returning a Promise that resolves to value after ms milliseconds.loadMessage() that awaits delay(10, "Hello Async") and returns uppercase text.safeDivide(a, b) that resolves to a / b when b is nonzero.b is zero, reject with Error("Division by zero").reportBroadcast() that calls both successful functions and logs HELLO ASYNC | 10/2 = 5; call it on startup.