Tutorial by Examples

TypeScript catches type errors early through static analysis: function double(x: number): number { return 2 * x; } double('2'); // ~~~ Argument of type '"2"' is not assignable to parameter of type 'number'.
TypeScript enables editors to provide contextual documentation: You'll never forget whether String.prototype.slice takes (start, stop) or (start, length) again!
TypeScript allows editors to perform automated refactors which are aware of the rules of the languages. Here, for instance, Visual Studio Code is able to rename references to the inner foo without altering the outer foo. This would be difficult to do with a simple find/replace.

Page 1 of 1