Appendix B. TypeScript as a language for Angular applications

You may be wondering, why not just develop in JavaScript? Why do we need to use other programming languages if JavaScript is already a language? You wouldn’t find articles about languages for developing Java or C# applications, would you?

The reason is that developing in JavaScript isn’t overly productive. Say a function expects a string value as an argument, but the developer mistakenly invokes it by passing a numeric value. With JavaScript, this error can be caught only at runtime. Java or C# compilers won’t even compile code that has mismatching types, but JavaScript is forgiving because it’s a dynamically typed language.

Although JavaScript engines do a good job of guessing ...

Get Angular 2 Development with TypeScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.