- 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.
- C++面向?qū)ο蟪绦蛟O(shè)計(jì)(第三版)
- iOS面試一戰(zhàn)到底
- 數(shù)據(jù)庫(kù)系統(tǒng)教程(第2版)
- 劍指Offer(專項(xiàng)突破版):數(shù)據(jù)結(jié)構(gòu)與算法名企面試題精講
- Java入門很輕松(微課超值版)
- SQL基礎(chǔ)教程(視頻教學(xué)版)
- Building Minecraft Server Modifications
- Hands-On Automation Testing with Java for Beginners
- Create React App 2 Quick Start Guide
- Emgu CV Essentials
- Fast Data Processing with Spark(Second Edition)
- Spring 5 Design Patterns
- 計(jì)算語(yǔ)言學(xué)導(dǎo)論
- Elasticsearch搜索引擎構(gòu)建入門與實(shí)戰(zhàn)
- MongoDB Administrator’s Guide