TypeScript Jumpstart for Beginners

What is TypeScript ?

TypeScript is a typed superset of JavaScript that compiles to JavaScript. TypeScript is ECMAScript 6 (ES6) with optional typing. It is an open-source programming language developed and maintained by Microsoft. TypeScript is object oriented and supports Encapsulation, Inheritance, Abstraction, and Polymorphism.

Why TypeScript?

  • Typescript implements Object Oriented Programming model making it easier to develop and maintain large applications.
  • Most popular framework like Angular and Ionic 2.0 are based on the TypeScript.
  • TypeScript compilation process notifies errors before converting it to JavaScript.
  • Angular Ahead-of-Time (AOT) compiler converts TypeScript code into efficient JavaScript code during the build phase before the browser downloads and runs that code, thus reducing the file size(.js) to be downloaded to client machine.

TypeScript Features and Construct

Static Typing :

TypeScript provides static typing through type annotations to enable type checking at compile time. This is optional and can be ignored to use the regular dynamic typing of JavaScript.

Classes

TypeScript supports classes similar to  C# and  supports inheritance and abstract classes.

Interfaces

Interfaces are used to enforce a contract that should be implemented by all the classes implementing that interface. TypeScript interface will not be present in the generated JavaScript output but are useful during the development process.

Modules

Modularity of the application is a must for the large applications.  Modules promotes reusability of the code and provides granular control over each module. ES6 module system treats every file as a module. A module can export classes, function and variables which can be used by the other modules.

We will share more feature and detailed tutorial of TypeScript in upcoming articles.

Thanks 🙂