Exponential backoff
Exponential backoff increases the waiting time between retry attempts by multiplying the previous delay by a fixed factor, usually two. A maximum delay caps the waiting time so retries remain bounded.
Minimal example
const delayLimit = Math.min(
maxMs,
baseMs * 2 ** (attempt - 1)
);