Problem Statement
Which property in the response object helps check if the Fetch API request succeeded?
Explanation
The 'ok' property of the Fetch API response object is true for status codes 200–299.
It’s a quick way to confirm whether the request was successful before reading the body.
Code Solution
SolutionRead Only
if (!response.ok) throw new Error('Network error');