Study notes · 8% of the exam
Browser APIs
The browser APIs you use every day: fetch, storage, cancellation and visibility.
Key points
- 1
fetchrejects only on network errors. Checkresponse.okfor HTTP errors. - 2
Cancel requests with an
AbortControllersignal; build deadlines withAbortSignal.timeout(ms). - 3
localStoragepersists andsessionStoragelasts one tab session; both store strings only. - 4
IntersectionObservertells you when elements become visible, which suits lazy loading and infinite scroll.
Common traps
Storage can throw (private mode, quota), so wrap access in try/catch.
Read the source
Test yourself on Browser APIs
Ten questions, with the answer and explanation after each one.