JavaScript 2025 · Promises and fetch

Pause for a while

A promise that resolves after a delay.

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
await sleep(1000);

Official JavaScript 2025 documentation

More promises and fetch commands

All promises and fetch commands · JavaScript 2025 cheatsheet

Was this page helpful?