Problem Statement
What is AbortController used for in Fetch API?
Explanation
AbortController allows cancellation of an ongoing fetch call to free network resources.
It’s often used when users leave a screen before a response arrives.
Code Solution
SolutionRead Only
const controller = new AbortController(); fetch(url, { signal: controller.signal }); controller.abort();