Skip to content
JavaScript·Advanced·Coding·1 min read

How does Promise.race implement a timeout?

Short interview answer

Race can choose a rejecting timer first, but it does not stop the losing operation. A robust timeout also aborts supported underlying work and clears its timer.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Promises

Related questions