🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Async JavaScript: all 10 questions

Quiz: Async JavaScript · Question 3 of 10

fetch() to a URL that returns HTTP 404. What happens?

fetch() to a URL that returns HTTP 404. What happens?

  1. A.The promise rejects
  2. B.The promise resolves; you must check res.ok
  3. C.The browser crashes
  4. D.It retries automatically
Answer & explanation

Correct answer: The promise resolves; you must check res.ok

fetch rejects only on network errors.

Can you get the rest right without peeking?

Take the timed Quiz: Async JavaScript quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →