What is `AbortController` and how is it used with `fetch()`?

JavaScript Developer Hard

JavaScript Developer — Hard

What is `AbortController` and how is it used with `fetch()`?

Key points

  • `AbortController` creates an `AbortSignal` for cancelling requests
  • `controller.abort()` rejects the `fetch()` request with an `AbortError`
  • Enables cancellation of ongoing network operations

Ready to go further?

Related questions