What is TypeScript and why should I use it over JavaScript?

Posted by PastimeNow@reddit | learnprogramming | View on Reddit | 55 comments

Hi guys, I've been coding in JavaScript for a few years (inconsistently but I have decent experience). I've done a few projects in it. The next project I was planning to work on primarily uses TypeScript in their documentation, hence I decided I would learn more about TypeScript. As far as I understand it is a better version of JavaScript, it's more clear, you have more control over the datatypes. But I don't understand in which scenario it is better to use TypeScript, are there things TypeScript can do but JavaScript cannot? How is it an advantage to use TypeScript? Why would you need better control over the data types when JavaScript does it all automatically?