Settings
Code Theme
Settings are saved automatically and applied across the site.
Code Display
Preview
interface User { id: number; name: string; email: string;}
async function fetchUser(id: number): Promise<User> { const response = await fetch(`/api/users/${id}`); if (!response.ok) { throw new Error('User not found'); } return response.json();}
const user = await fetchUser(1);console.log(user.name);