← Back to Tutorial
TypeScript Compiler
TypeScript Code
Clear
Compile ▶
type StringOrNumber = string | number; type UserId = number; type UserName = string; type Callback<T> = (value: T) => void; const userId: UserId = 123; const processValue: Callback<string> = (value) => { console.log(`Processing: ${value}`); };
Output
Download JS
TypeScript code will be compiled here