Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

What is TypeScript and why would I use it in place of JavaScript?

Can you please describe what the TypeScript language is?

How would it be able to respond that JavaScript or accessible libraries can't do, that would give me a reason to think about it?
by

2 Answers

aashaykumar
TypeScript does something similar to what less or sass does for CSS. They are super sets of it, which means that every JS code you write is valid TypeScript code. Plus you can use the other goodies that it adds to the language, and the transpiled code will be valid js. You can even set the JS version that you want your resulting code on.

Currently TypeScript is a super set of ES2015, so might be a good choice to start learning the new js features and transpile to the needed standard for your project.
RoliMishra
Ecma script 5 (ES5) which all browser support and precompiled. ES6/ES2015 and ES/2016 came this year with lots of changes so to pop up these changes there is something in between which should take cares about so TypeScript.

• TypeScript is Types -> Means we have to define datatype of each property and methods. If you know C# then Typescript is easy to understand.

• Big advantage of TypeScript is we identify Type related issues early before going to production. This allows unit tests to fail if there is any type mismatch.

Login / Signup to Answer the Question.