← 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?
- A.The promise rejects
- B.The promise resolves; you must check res.ok
- C.The browser crashes
- 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 →