JavaScript 2025 · Promises and fetch
Run promises in parallel
Wait for all promises. It rejects as soon as one fails.
const [users, posts] = await Promise.all([getUsers(), getPosts()]);
Official JavaScript 2025 documentation
More promises and fetch commands
- Fetch JSON
- POST JSON
- Time out a request
- Handle errors in async code
- Wait for all promises, whatever happens
- Pause for a while
All promises and fetch commands · JavaScript 2025 cheatsheet