Angular with TypeScript or JavaScript?

0

Searching a little about Angular (v 2+) I saw that in many places it is commented that Angular has TypeScript support and that its use is more common than pure JavaScript, so what are the advantages and disadvantages of using TypeScript or JavaScript in Angular?

    
asked by anonymous 20.06.2018 / 02:40

1 answer

2

Specifically for Angular the advantage is to use the same language as it is written.

The biggest advantage is more general, the language is statically typed (at least on the surface), which leaves the code more scalable to work than a dynamic typing. Dynamic typing is for scripts , works fine when JS was used for scripts , when they started making applications in it got complicated. TypeScript gives more robustness.

Of course, language has more features , it has evolved very fast because it is not a committee language. I do not know the future of Angular with the advent of WebAssembly , many people may opt for a solution that do not use either JS, TS, or Angular.

For general differences, see: CoffeeScript, TypeScript and JavaScript .

The downside is that it is one more layer, you program in one language that will be converted to another. With the existing tools they managed to do something surprisingly good.

    
20.06.2018 / 03:03