TypeScript
?
Loading...
Examples
Classic JavaScript
Adding Types
Using Classes
Using Inheritance
Using Generics
Unions and Type Guards
Building a Raytracer
Mapped types (Readonly, Partial)
Bounded polymorphism
Conditional types
async/await
Decorators (experimental)
JSX
Options
Loading...
Run
Use Ctrl + Enter
to run compiled JavaScript in the browser console.
Use Ctrl + S
to copy code url to the clipboard.
Use Alt + Shift + F
to run Prettier.
About
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
Playground allows you to compile TypeScript and see JavaScript output.
Differences from
typescriptlang.org/play
:
– All strict options turned on by default
– More available compiler options
– Ability to switch TypeScript version
– More space for code
– More examples
– Quicker sharing, URL updates as you type
– Shorter sharing URLs
–
Open source
TS changelog
TS docs