Language reference / TypeScript
Get AI-powered explanations for TypeScript code. Understand generics, type inference, discriminated unions, and advanced type patterns.
01 Read a small example
Start with four numbers: −3, 0, 2 and 5. Keep each number greater than zero. The result contains 2 and 5, in the same order.
An authored TypeScript teaching snippet. Paste it into the workspace and select TypeScript to explore your own explanation.
const numbers: number[] = [-3, 0, 2, 5];
const positive = numbers.filter(number => number > 0);Understand complex generics
Debug type inference
Learn discriminated unions
Analyze mapped types
Get instant explanations for common TypeScript patterns and frameworks
Paste any TypeScript code and get an instant, detailed explanation tailored to your experience level.
Explain TypeScript Code Now