You pass controller.signal to an API that supports it (timers, fetch, fs…). Calling controller.abort() makes the operation reject with an AbortError. AbortSignal.timeout(ms) makes a signal that aborts by itself.