Programming Languages
TypeScript Playground
Write TypeScript - type annotations are stripped, code runs as JS.
Runtime: ts-blank-space + sandboxed iframe
About this playground
Write TypeScript on the page. Type annotations are stripped via ts-blank-space (a fast, type-only stripper that preserves source positions) and the resulting JavaScript runs in the same sandboxed iframe as the JS playground. No type-checking, no bundler - just types-on-top-of-JS in your browser.
FAQs
Does this type-check?
No - we only erase type annotations and run the JavaScript. For real type-checking, run tsc locally or in your editor. Adding tsc to the browser would mean a ~15 MB WASM download.
Why ts-blank-space?
It only deletes type-annotation tokens and leaves everything else byte-identical, including line numbers - so runtime errors map back cleanly to your source.
Are decorators / enums supported?
Decorators in current TS syntax (Stage 3 / ES decorators) work. Old legacy decorators and TypeScript-only enums are not part of ts-blank-space's scope; the runtime-emitted JS for enums is preserved if you use `const enum` patterns.
Does anything leave the browser?
No. ts-blank-space loads from a CDN once; after that everything happens locally in a sandboxed iframe.