Official website: https://www.typescriptlang.org
Source code: https://github.com/Microsoft/TypeScript
How to use TypeScript?
A TypeScript code is written in a file with
A TypeScript file can be written in any code editor. A TypeScript compiler needs to be installed on your platform. Once installed, the command
TypeScript installation for various platforms and the compilation process is detailed in the next section, along with the code examples.
- Object Oriented Language: TypeScript provides powerful features such as Classes, Interfaces, and Modules. You can write pure object-oriented code for client-side as well as server-side development.
- Static type-checking: TypeScript uses static typing. This is done using type annotations. It helps type checking at compile time. Thus, you can find errors while typing the code without running your script each time. Additionally, using the type inference mechanism, if a variable is declared without a type, it will be inferred based on its value.
- ES 6 Features: TypeScript includes most features of planned ECMAScript 2015 (ES 6, 7) such as class, interface, Arrow functions etc.
- TypeScript is an open-source language with continuous development and maintenance by Microsoft.
- TypeScript is also closer in syntax to back-end languages like Java and Scala. This helps backend developers write front-end code faster.
- TypeScript has easy integration with task runner tools like Grunt and Gulp to automate the workflow.
Now that we know the inspiration behind TypeScript and the various advantages it provides to build large scale applications, let us look into how to install and setup TypeScript in the next tutorial.