Web platform

Promises and async functions

A Promise represents eventual completion or failure. An async function returns a Promise, and await pauses that function until a value settles.

Ask the Web platform assistant 1 min read · Updated September 9, 2026

What it is

A Promise represents eventual completion or failure. An async function returns a Promise, and await pauses that function until a value settles.

Why it matters

Await does not move CPU work to another thread. A long synchronous loop still blocks interaction.

Example

Awaiting fetch lets other work run while data arrives; parsing a huge JSON string afterward still uses the current thread.

Technical detail

A rejected promise must be handled through await with try/catch or a rejection handler.

When to use it

Start independent requests together, then await their results. Keep dependent mutations in the required order.

Sources

More in Web platform

Assembled from the ReLU.chat curated knowledge base. These explanations are concise on purpose; check the sources for anything important.