Fetch API & Async JavaScript
✓ Completed
Modern web apps communicate with servers using the Fetch API. This lesson covers async/await, Promises, JSON parsing, and error handling.
javascript
async function getUser(id) {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) throw new Error('Not found');
return res.json();
}