Hint
Syntactic sugar over Promises; await pauses the function, not the thread
async/await is syntactic sugar over Promises. An async function always returns a Promise. await pauses only that function's execution.
async function fetchUser(id) {
try {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) throw new Error('Not found');
return await res.json();
} catch (err) {
console.error(err);
}
}