TypeScript 学习指南 Part 5 Playground

450 阅读1分钟

www.typescriptlang.org/play

A live environment for exploring, learning and sharing TypeScript code. Try different compiler flags, run through extensive code samples to learn specifics about how TypeScript works.

探索、学习和共享TypeScript代码的实时环境。尝试不同的编译器标志,运行大量的代码示例,以了解TypeScript如何工作的细节。

image.png

可切换为中文,方便快速学习。各例子值得过一遍。30分钟

image.png

image.png

image.png

可实时查看TS编译后的JS,也可以通过Settings勾选‘[开发中]展示AST’

image.png

image.png

可以选择不同配置(对应tsconfig.json),在 tab JS 下查看生成的不同版本的JavaScript

image.png