Why TypeScript ?

The new ES6 / ES2015 standard brought many new tools in JavaScript, like classes syntax, modules imports/exports, block-scoped variables, etc., bringing JavaScript closer to other languages like Java, C# or PHP for big and serious developments.

But some important features are still missing, like static data types and some basic tools in object oriented programming like pre-declared properties, visibiliy modifiers and interfaces. And you'll be very frustrated about that, or if you're not, you'll soon be annoyed by that when your app will crash because of too weak development tools.

TypeScript adds these missing features in a very clever way. Valid vanilla JavaScript is valid TypeScript : the new features are completely optional, and you can come back to pure JS at any time.

Of course, you'll need to transform TypeScript to standard JavaScript for browsers, but in today JavaScript development, you'll need to transform ES6+ to ES5 anyway for browsers compatibility, you'll need to minify your files for performance, etc. So you'll have a build step anyway.

Major JavaScript frameworks like Angular 2 use TypeScript.

Last but not least : are you tired of guessing what you can do while coding in JavaScript ? With a Typescript aware editor, like Visual Studio Code, and typings, you'll have a full and correct autocomplete for JavaScript and any library. Yes, for real.

Come back to the guides list