What is TypeScript and should you even use it?
TypeScript is a language made by Microsoft. It is a superset of JavaScript meaning it adds features to vanilla JavaScript.
TypeScript adds static typing to JavaScript. What the does this mean?
Vanilla JavaScript it dynamically typed, which means the type (const, string, int etc) is checked at run time, which can be missed.
In TypeScript, Types checked before run-time (tracking bugs before shifting your code). This means its easier to spot bugs early on.
Here is a comparison between TypeScript(Left) and JavaScript(Right).
Now, when should you use TypeScript?
The benefits of TypeScript kick in when you are working on a large project ( more than 2 files), otherwise it doesn't really make sense to use it. With all that being said, the bottom-line is
TypeScript is AWESOME!
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.