What is TypeScript?
Why TypeScript?
JavaScript is standardized through the ECMAScript standards. TypeScript supports most of the latest ECMAScript features (the various posts under ECMAScript can be found here). Some of the interesting features of latest ECMAScript like modules, lambda functions, classes, the spread operator, destructuring, template literals are supported in TypeScript.
TypeScript makes JavaScript more and reliable by having following features
- Optional static typing
- Supports the latest JavaScript features
- Supports classes, interfaces, generics
- More productive than JavaScript
Optional static typing
JavaScript is dynamic type, it does not know type of variable until we initialize it. Typescript provides types support to code. Using static typing we can define the data type of the variable.
var x : string = "Make a smile";
Here we have declared a variable of type string. The popular data types available in TypeScript are Boolean, Number, String, Array, Tuple, Enum, Any, and etc.
We have mentioned TypeScript is optional static typing.
What does it mean?
It means, we don’t have to mention the exact type of variable always. If we don’t wish to mention the type of variable, we can user any type to declare the variables. Once we are initializing the any type variable, it will decide the type of variable based on the values.
example:
var y: any = “Clear Screen”;
Supports the latest JavaScript features
Most features of ECMAScript has been supported by TypeScript.
The latest features of ECMAScript like
- Arrow functions
- Classes, Inheritances
- Destructuring
are supported in TypeScript as well. We can discuss about those topics in upcoming blog posts.
More productive than JavaScript
If the developer is already familiar with any of the Object Oriented Programming, it will be easy for them to adopt to TypeScript. The syntax are similar to Object Oriented language like C#.
As C# developer, in my personal experience I felt learning and understanding the syntax of TypeScript is easy.
IDEs can help you throwing error right away when you are coding itself. So you can focus more on coding and less time at debugging. Enhanced IDEs provides greater support to this language which provides significant productivity compared working with JavaScript.
This is just an introductory post, we can discuss more topics under TypeScript in upcoming posts. Please share your thoughts in comments section and follow this site for more updates.
Happy Coding!
Excellent blog here! Additionally your web site loads up very fast! What web host are you the usage of? Can I am getting your affiliate hyperlink in your host? I desire my web site loaded up as quickly as yours lol
LikeLiked by 1 person
Yup! thanks. I’m using WordPress 🙂 You can follow my blog for more interesting updates in future.
LikeLiked by 2 people
I do believe all of the ideas you’ve introduced to your post. They’re really convincing and will certainly work. Still, the posts are very short for starters. Could you please lengthen them a bit from subsequent time? Thank you for the post.
LikeLiked by 1 person
Sure, I shall post the second part soon and remaining parts at frequent intervals.
LikeLiked by 1 person
whoah this weblog is great i love reading your posts. Stay up the good work! You realize, many persons are looking round for this info, you can aid them greatly.
LikeLiked by 2 people
Sure. Thanks, scott. We will be uploading new posts at regular intervals. stay connected, and follow the site you get notified of every new post.
LikeLiked by 1 person
F*ckin’ amazing things here. I am very satisfied to peer your article. Thanks so much and i’m taking a look ahead to contact you. Will you please drop me a mail?
LikeLiked by 1 person
Feel free to reach me via twitter: https://twitter.com/Pandiyan_cool
LikeLiked by 2 people