Learn everything you need to know about TypeScript. TypeScript Overview - Learn TypeScript in simple and easy steps starting from basic to advanced concepts with examples including Overview, Environment Setup, Basic.
- TypeScript Tutorial
- TypeScript Useful Resources
![Typescript Typescript](/uploads/1/2/5/2/125216730/914969115.png)
- Selected Reading
TypeScript lets you write JavaScript the way you really want to. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. TypeScript is pure object oriented with classes, interfaces and statically typed like C# or Java. The popular JavaScript framework Angular 2.0 is written in TypeScript. Mastering TypeScript can help programmers to write object-oriented programs and have them compiled to JavaScript, both on server side and client side.
Programmers coming from Object Oriented world will find it easy to use TypeScript. With the knowledge of TypeScript, they can build web applications much faster, as TypeScript has good tooling support.
As a reader of this tutorial, you should have a good understanding of OOP concepts and basic JavaScript, to make the most of this tutorial.
For most of the examples given in this tutorial you will find Try it option, so just make use of it and enjoy your learning.
Try following example using Try it option available at the top right corner of the below sample code box:
On compiling, it will generate following JavaScript code.
TypeScript tutorial provides basic and advanced concepts of TypeScript. Our TypeScript Tutorial is designed for beginners and professionals both.
TypeScript is an open-source, object-oriented programing language, which is developed and maintained by Microsoft under the Apache 2 license. It was introduced by Anders Hejlsberg, a core member of the development team of C# language. TypeScript is a strongly typed superset of JavaScript which compiles to plain JavaScript. It is a language for application-scale JavaScript development, which can be executed on any browser, any Host, and any Operating System. TypeScript is not directly run on the browser. It needs a compiler to compile and generate in JavaScript file. TypeScript is the ES6 version of JavaScript with some additional features.
Our TypeScript tutorial includes all the topics which help to learn TypeScript. These are Introduction of TypeScript, Features of TypeScript, Components of TypeScript, TypeScript first program, TypeScript Types, TypeScript Variables, TypeScript Operators, TypeScript Decision-making, TypeScript Loops, Functions, Classes, Arrays, Namespace, Module, Ambient, and many more.
What is TypeScript?
TypeScript is an open-source pure object-oriented programing language. It is a strongly typed superset of JavaScript which compiles to plain JavaScript. It contains all elements of the JavaScript. It is a language designed for large-scale JavaScript application development, which can be executed on any browser, any Host, and any Operating System. The TypeScript is a language as well as a set of tools. TypeScript is the ES6 version of JavaScript with some additional features.
TypeScript cannot run directly on the browser. It needs a compiler to compile the file and generate it in JavaScript file, which can run directly on the browser. The TypeScript source file is in '.ts' extension. We can use any valid '.js' file by renaming it to '.ts' file. TypeScript uses TSC (TypeScript Compiler) compiler, which convert Typescript code (.ts file) to JavaScript (.js file).
History of TypeScript
In 2010, Anders Hejlsberg, a core member of the development team of C# language, started working on TypeScript at Microsoft. The first version of TypeScript was released to the public in the month of 1st October 2012 and was labeled as version 0.8. Now, it is maintained by Microsoft under the Apache 2 license. The latest version of Typescript is TypeScript 3.5, which was released to the public on May 2019.
Why use TypeScript?
We use TypeScript because of the following benefits.
- TypeScript supports Static typing, Strongly type, Modules, Optional Parameters, etc.
- TypeScript supports object-oriented programming features such as classes, interfaces, inheritance, generics, etc.
- TypeScript is fast, simple, and most importantly, easy to learn.
- TypeScript provides the error-checking feature at compilation time. It will compile the code, and if any error found, then it highlighted the mistakes before the script is run.
- TypeScript supports all JavaScript libraries because it is the superset of JavaScript.
- TypeScript support reusability because of the inheritance.
- TypeScript make app development quick and easy as possible, and the tooling support of TypeScript gives us autocompletion, type checking, and source documentation.
- TypeScript has a definition file with .d.ts extension to provide a definition for external JavaScript libraries.
- TypeScript supports the latest JavaScript features, including ECMAScript 2015.
- TypeScript gives all the benefits of ES6 plus more productivity.
- Developers can save a lot of time with TypeScript.
Text Editors with TypeScript Support
The TypeScript was initially supported only in Microsoft's Visual Studio platform. But today, there are a lot of text editors and IDEs available which either natively or through plugins have support for the TypeScript programming. Some of them are given below.
- Visual Studio Code
- Official Free Plugin for Sublime Text.
- The latest version of WebStorm
- It also supports in Vim, Atom, Emacs, and others.
TypeScript Tutorial Index
Differences
Interview Questions
Prerequisite
Before learning TypeScript in depth, you must have the basic knowledge of OOPs concept and JavaScript.
Audience
We have developed this TypeScript tutorial for beginners and professionals both. There are given a lot of examples with TypeScript editor. So, you can easily edit your TypeScript code which will help you to learn TypeScript easily.
Problems
We assure you that you will not find any problem in our TypeScript tutorial. But, if you find any mistake, you can post it in our comment section.