JS Built-ins
AbortControlleradvanced

AbortController β€” abort is idempotent (first reason wins)

πŸ“– Usage Example
const ac = new AbortController()
ac.abort()
ac.abort()  // calling again has no effect

Calling abort() more than once is safe; only the first call has effect.

AbortController idempotency

Once aborted, calling abort() again has no effect β€” the original reason is preserved.

Challenge: Abort twice with different reasons and verify the first reason is kept.

πŸ’‘ Hints (1)
  • β€’ Once a signal is aborted, subsequent calls to abort() are ignored β€” the signal is immutable after the first abort