AI Typing Code · typescript
Generics, unions, and conditional types at speed
The hardest-to-type characters in TypeScript are <>, |, &, and : — this drill targets them on real interface and generic code.
What you'll practice
- ✓angle brackets <T> for generics
- ✓union and intersection types
- ✓optional ? and non-null !
- ✓type assertions (as, satisfies)
- ✓interface member access
Sample drills
type annotations
const name: string = "Alice";
const age: number = 30;
const active: boolean = true;
const tags: string[] = ["admin"];
const meta: Record<string, unknown> = { version: 1 };Practice this drill →interface basic
interface User {
id: number;
name: string;
email?: string;
}
const user: User = { id: 1, name: "Alice" };Practice this drill →Who it's for
TypeScript developers, React engineers, library authors