Write a fetch call and log JSON from the Response

This tests async HTTP literacy and fetch's two-stage promise resolution. A strong answer awaits fetch, then awaits response.json(), logs result, and notes fetch does not throw on 4xx/5xx.
This tests whether you understand the Fetch API's promise lifecycle and two-stage resolution pattern. A strong answer uses async/await to call fetch, checks response.ok or status, awaits response.json() to parse the body, logs the parsed data, and explicitly notes that fetch resolves rather than rejects on HTTP error codes like 404 or 500. Red flag: treating the initial Response as the payload, forgetting that json() itself returns a promise, or omitting any mention of error handling.
Read the original → developer.mozilla.org
- #fetch api
- #async/await
- #javascript
- #typescript
- #web apis
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.