- 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.
- Learning PostgreSQL
- 圖解Java數(shù)據(jù)結(jié)構(gòu)與算法(微課視頻版)
- NativeScript for Angular Mobile Development
- Python計算機視覺編程
- Java性能權(quán)威指南(第2版)
- ADI DSP應(yīng)用技術(shù)集錦
- Mastering Google App Engine
- SharePoint Development with the SharePoint Framework
- Rust Essentials(Second Edition)
- JavaCAPS基礎(chǔ)、應(yīng)用與案例
- Multithreading in C# 5.0 Cookbook
- Python深度學(xué)習(xí):模型、方法與實現(xiàn)
- TypeScript 2.x By Example
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Mastering Gephi Network Visualization