Java Certification Training Course
- 45k Enrolled Learners
- Live Class
var message:string = "Welcome to Edureka!" console.log(message)
//Generated by typescript 1.8.10 var message = "Welcome to Edureka!"; console.log(message);
Using new features of ECMAScript:
TypeScript supports new ECMAScript standards and transpile them to ECMAScript targets of your choice. So, you can use features of ES2015 and beyond, like modules, lambda functions, classes, the spread operator, de-structuring, today.
TypeScript makes typing a bit easier and a lot less explicit by the usage of type inference. Even if you don’t explicitly type the types, they are still there to save you from doing something which otherwise would result in a run-time error.
Better IDE support
Strict Null Checking
Now let’s see what are the different benefits of using TypeScript.
Now that you know what is TypeScript and its features, let’s understand the different components of TypeScript.
There are three different types of components in TypeScript which includes:
Language − It comprises of the syntax, keywords, and type annotations.
The TypeScript Language Service − The Language Service exposes an additional layer around the core compiler pipeline, editor-like applications. The language service supports the common set of typical editor operations.
There are two main ways to install TypeScript tools such as:
If you use Visual Studio or VS Code IDE, the easiest way to add to Visual Studio or VS Code is to search and add a package or download from the TypeScript website. Also, you can download TypeScript Tools for Visual Studio.
You can click on download and install TypeScript in your system.
var selectedValue=" ";
But in TypeScript, the declaration is done in the following way:
AccessModifier Property/Variable Name Colon(:) dataType
var name:string = "Daisy"; var empid:number = 1001; console.log("name"+name) console.log("employee id "+empid)
//Generated by typescript 1.8.10 var name = "Daisy"; var empid = 1001; console.log("name" + name); console.log("employee id: " + empid);
With this, we have come to the end of this article. I hope you understood What is TypeScript. If you want to know the basics and fundamentals of TypeScript, You can check out the TypeScript Tutorial for better understanding.
Check out the Web Development Certification Training by Edureka. Web Development Certification Training will help you Learn how to create impressive websites using HTML5, CSS3, Twitter Bootstrap 3, jQuery and Google APIs and deploy it to Amazon Simple Storage Service(S3).
Got a question for us? Please mention it in the comments section of “What is TypeScript?” and we will get back to you.