If you still do not know:
JavaScript won . Today it is the most cross-platform language available for any device. On it you can create web applications (client and server), including those with offline operation mode, desktop applications (for Windows 8), applications for smartphones and tablets (PhoneGap), extensions for Microsoft Office, SharePoint and Dynamics. JavaScript code works in DBMSs such as MongoDB and even Hadoop in Windows Azure (BigData however).
Javascript has already written Doom and a Linux emulator. In fact, solving any task other than writing an OS kernel module, you will encounter JavaScript. If you do not know JavaScript yet, then you should urgently start studying it.
JavaScript has many drawbacks.
Many developers have this reaction to javascript:
')

(picture taken
from here )
Most people are afraid of the lack of intellisense when typing code and manipulating HTML / CSS. But this is not the biggest problem.
The biggest problem with javascript is that it was not Microsoft.The main disadvantages of JavaScript:
- Dynamic typing, which causes a lot of regression errors.
- Lack of modularity. There are neither modules, nor classes, the prototype OOP tears the brain to those who write in C ++ \ Java \ C #.
- Unobvious behavior in many places.
In order not to write JavaScript, Java compilers were created -> JavaScript, C # -> JavaScript, LLVM -> JavaScript. But all this leads to the fact that the program in the source language is subject to significant restrictions, as well as existing libraries for JavaScript are not used.
TypeScript corrects some of the flaws.
Microsoft, looking at this picture, decided that we need a language that, on the one hand, fixes problems, on the other hand, it is as close as possible to JavaScript in order to use existing practices.
And so appeared the TypeScript language (
link to offsite ). TypeScript is a superset of JavaScript. That is, any valid JavaScript code is also a valid TypeScript code.
TypeScript uses static typing, that is, all types are checked during compilation. By the way, the TypeScript compiler itself is written in TypeScript and is open source (
link to the repository ).
TypeScript adds the ability to declare modules, classes, and interfaces. This allows you to scale the development of complex JavaScript applications.
The output is plain javascript, which does not require additional libraries or special components.
TypeScript in action
When typing code in VisualStudio a rich hint is available:

Classes, annotations and type inference are supported, interactive debugging works.
You can easily use external libraries in TypeScript, for example jquery:

If the types do not match, the compiler curses:

TypeScript compilation occurs when building a project, checking for many errors without running.
Well, the most important feature, the sight of which I almost burst into tears:

Whoever is not fully inspired can look at the
raytracer at TypeScript , the
result of the work .
How to start using TypeScript
If you use VisualStudio, then you need to put two extensions:
Then you will have this editing mode:

TypeScript on the left, JavaScript compilation on the right. Thus, using TypeScript will help you better understand and learn JavaScript.
Those who do not use visual studio, a little less lucky. Currently available
plugins for common text editors , as well as command line tools.
Further you should read
tutorials from a real dad , sometimes it is worth looking into the
specification .
A variety of type definitions for popular libraries can be found in the
DefinitelyTyped project. Judging by the nickname of the author of the project, this is our compatriot.
Conclusion
This was an introductory article. Next time there are more examples and the actual use of TypeScript.