fetch and JSON APIs
Comes up in: Recruiter screen, UI coding, Machine coding
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
fetch(url)response.okand status (fetch does not reject on 404)response.json()- loading/error/empty states
- query strings
- a public API with CORS enabled
Words you will know
What you will practise
- weather or quotes app with loading and error states
Interview questions this answers
- Does
fetchreject on a 404 response? How do you handle errors correctly?