Engrain by ByteRush

FND.10.05 BeginnerCore — asked often

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.ok and 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

APIendpointfetchJSONloading state

What you will practise

  • weather or quotes app with loading and error states

Interview questions this answers

  • Does fetch reject on a 404 response? How do you handle errors correctly?