Aviva Directory » Computers & Internet » Programming » JavaScript » TypeScript

After two years of development by Microsoft, TypeScript was launched in October of 2012. It is a free, open-source superset of JavaScript created for the development of large programs.

The new language was created to overcome the limitations of JavaScript for the development of large-scale applications without breaking compatibility with standard JavaScript.

As a superset of JavaScript, TypeScript compiles directly to JavaScript code, and adds several new features on top of JavaScript, resulting in a strongly-typed, object-oriented language, similar to C# and Java.

Because of this, TypeScript is easier to use in large projects, with code that is easier to understand and maintain. Due to strong-typing, the language is precompiled, and variables cannot be assigned values that are out of their declared range. For example, when a TypeScript variable is declared as a number, a text value cannot be assigned to it.

Strong typing and object orientation also means that the language is easier to debug and maintain, solving two of the weakest points of standard JavaScript.

Originally released without support for integrated development environments (IDEs), except for Microsoft Visual Studio, which was not available for Linux and OSX. However, by 2013, TypeScript 0.8 included support for generics, and an update to Visual Studio 2013 provided default support for TypeScript.

As a superset of JavaScript (also known as ECMAScript 5), a JavaScript program is also a valid TypeScript program, allowing TypeScript to use existing JavaScript code, incorporate JavaScript libraries, and call TypeScript-generated code from other JavaScript.

The TypeScript compiler (tsc) is written in TypeScript, so it can be compiled into regular JavaScript, and executed in any JavaScript engine, such as a web browser. The compiler package is bundled with a script host that can execute the compiler. Currently, the compiler supports ECMAScript 5 by default, but an option allows it to target ECMA 2015 so that language features exclusive to that version can be used. Classes are available in both modes.

The focal point of this portion of our guide is the programming language known as TypeScript, including any software tools designed to facilitate it, as well as any implementations of the language, guides, tutorials, user groups, and forums.



Recommended Resources

Search for TypeScript on Google or Bing