JavaScript with syntax for types. a tool that runs before your code runs (static) and ensures that the types of the program are correct (typechecked).
为 JavaScript 程序员准备的 TypeScript
Narrowing是指缩小变量类型的范围,从而使编译器能够更精确地了解该变量的类型。TypeScript不仅包含了类型检查,还了解 if/else 分支、三元表达式、循环等可能会影响类型的各个结构流