...

/

Why Use TypeScript?

Why Use TypeScript?

Learn why Angular is built on TypeScript and what benefits this brings to Angular developers.

What is TypeScript?

In AngularJS, everything was written in JavaScript. With the new version of Angular, the decision was made to write everything using Typescript. There are many reasons for this change, but first, let’s take a look at what TypeScript is.

TypeScript is from Microsoft, and according to the official website:


TypeScript is a superset of JavaScript that compiles down to plain JavaScript.


What this means is that TypeScript has a larger set of features that JavaScript doesn’t have, but when you save your TypeScript file, the TypeScript compiler transforms the TypeScript code to plain JavaScript. Let’s see why Angular needs TypeScript?

Why is Angular written in TypeScript?

Let’s see why Angular is written in TypeScript and what benefits it brings for Angular developers.

Introduction of a new feature is slow in JavaScript

The simple reason is that JavaScript, while a fantastic language, moves slowly when adding new features. For a new feature to be added to the language, it has to be discussed by all the relevant committees (JavaScript, while not being owned by anyone, is governed by a committee of community leaders and representatives for ...