Developer Academy

TypeScript

Drills < > : ; | ?

Type it exactly as written, including indentation and line breaks. Press Enter at the end of each line.

0wpm
100% acc
0:00Time
interface Result<T> { data: T | null; error?: string; meta: { page: number; total: number }; } function unwrap<T>(result: Result<T>): T { if (result.data === null) throw new Error(result.error ?? "empty"); return result.data; }

Just start typing.Tabrestarts