Answer the question
In order to leave comments, you need to log in
Angular2: JavaScript or TypeScript?
I want to master Angular2... Should I switch
to TypeScript or can I write in good old JS?
How would be more correct?
Answer the question
In order to leave comments, you need to log in
The question was asked incorrectly.
Everyone writes in whatever suits them and you don't have to listen to those who say "JavaScript only" and "TypeScript only"
My opinion - write in JS if you know it well. JS is JS and TS is JS with, say, C++ (of course IMHO). What's the point of adding incomprehensible (especially if you haven't learned more OOP languages) supplements when you can write without them?
However, if you want to learn TS, I won't dissuade you :)
Of course, as convenient for you, but my advice is Type Script.
Why?
- Strong typing (Less chance of error as a result)
- When using a good editor / IDE - useful hints
- Angular advises to use TS, that's why many examples, tutorial videos are also provided on TS
It was very uncomfortable to switch from Angular 1 + JS to Angular 2 + Typescript.
But over time, I got used to and appreciated all the advantages of web components and a full-fledged OO language.
Instead of a thousand checks, you can write an interface and any data mismatch will be prompted by the IDE or compiler.
So typescript.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question