- Switching to Angular(Third Edition)
- Minko Gechev
- 176字
- 2021-07-02 15:23:35
Compile-time type checking
One of the most common mistakes we make while writing JavaScript code is to misspell a property or a method name. Usually, we find out about the mistake when we get a runtime error. This can happen during development as well as during production. Hoping that we will know about the error before we deploy our code to the production environment isn't a comfortable feeling! However, this is not a problem specific to JavaScript; it is something common to all the dynamic languages. Even with lots of unit tests, these errors can slip by.
TypeScript provides a compiler, which takes care of such mistakes for us using static code analysis. If we take advantage of static typing, TypeScript will be aware of the existing properties a given object has, and if we misspell any of them, the compiler will warn us with a compile-time error.
Another great benefit of TypeScript is that it allows large teams to collaborate since it provides formal, verifiable naming. This way, it allows us to write easy-to-understand code.
- Instant Testing with CasperJS
- Mastering Adobe Captivate 2017(Fourth Edition)
- 架構不再難(全5冊)
- 深入理解Django:框架內幕與實現原理
- Vue.js 2 and Bootstrap 4 Web Development
- INSTANT Mercurial SCM Essentials How-to
- Haxe Game Development Essentials
- Jupyter數據科學實戰
- C程序設計實踐教程
- Visual FoxPro程序設計習題集及實驗指導(第四版)
- Visualforce Developer’s guide
- SQL Server 2008 R2數據庫技術及應用(第3版)
- 一步一步跟我學Scratch3.0案例
- Hands-On Dependency Injection in Go
- 算法精解:C語言描述