D
D
Dilik Pulatov2018-03-09 13:35:35
JavaScript
Dilik Pulatov, 2018-03-09 13:35:35

What is the point in TypeScript?

Hello!
I started to learn TypeScript (because of Angular) but the question arises ... why TypeScript at all?
when TypeScript wrote the code and when compiled to javascript, it turns out like this and now you can change it as it is convenient for us when working ... well, why TypeScript at all? or I misunderstood something?
let year:number = 2018
var year = 2018

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
eeiaao, 2018-03-09
@dilikpulatov

If we generalize the question, we get: Why do we need static typing?
Static typing reduces the chance of error. For example, year should contain a number, not a string, not an array, not an object. This will make the idea more clear. If there is an error during compilation, you will know that there is a bug somewhere and the program may behave incorrectly.
Plus, your ide will probably tell you where you are doing something wrong.
In general, development and debugging will accelerate, it will be easier to expand the project.

S
Stanislav Makarov, 2018-03-09
@Nipheris

https://toster.ru/answer?answer_id=928034

R
RidgeA, 2018-03-09
@RidgeA

and do not change the compiled code - it was not compiled for that.

P
pavel pavlov, 2020-10-09
@pwd_jun

few

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question