Typescript Basics
Typescript is not entirely a language is a superset of JavaScript. Is have many features that are not supported by the current version of JavaScript supported most browser outside.
- Strong-typing – like before use you need to declare the variable type like most programming languages like C#, Java.
- Object-Oriented features like classes, generic, public-private protected arrow function like that
- We can catch error at compile time not run time.
- Get access to best tools like intellicense for the code editor
- Any valid JavaScript code is valid typescript code.
- When you compiled your program it will transpile it into Javascript code.
- When you build application Typescript compiler kicks in and transpile the application typescript code to javascript.
To install typescript on machine you can use below command.
npm install -g typescript
Latest version of typescript is typescript@3.4.2
tsc –version