aweber-banner
Getting started with TypeScript - All you need to know

Getting started with TypeScript - All you need to know

In this article, we will learn about what is Typescript, and why we needed it and what's the benefits it provides over the JavaScript.

so,let get started…

What is TypeScript?

TypeScript is an open source, plain and class-based object-oriented programming language used to create and maintain large and complex Javascript applications easily.

Typescript is also know as Super set of JavaScript with added feature, so Every Valid JavaScript Code is Valid Typescript code.

Typescript is create and maintained by Microsoft.

Need of TypeScript?

Basically JavaScript is the client side scripting language where we can do DOM manipulation, client side validation, event handling etc.

But as the complexity of code increases, it becomes difficult to maintain because of the limitation of JavaScript.

But JavaScript is the only client side scripting language and browser only understands JavaScript.

So solution is to develop a Language which is rich in features and can be transpilled to JavaScript.

Typescript is one such a language which can be compile to JavaScript.

That is why TypeScript is called as Superset of JavaScript.

JavaScript limitation

JavaScript is dynamically typed, which means deciding the data type of the variable at runtime..

JavaScript doesn't support object-oriented programming features such as classes, interfaces, inheritance etc.

TypeScript Advantages:

Typescript is an open source pure object-oriented programming language.

TypeScript is a superset of JavaScript which compiles to plain JavaScript.

Designed for large scale JS application development, which can executed on any browser, any Host any any OS

Typescript supports Static Typing, Modules, Optional parameters, etc.

TypeScript supports Object-Oriented programming features such as classes, interfaces, inheritance, etc..

How Typescript works?

In single page application(SPA) like Angular or Ionic, we program using Typescript and it compiles into plain and browser readable Javascript,this is how we easily program complex and largeApplication in easy and maintainable way using Typescript.

Typescript is Resembles Langues  Like Java and C# which gives us Gives us a bunch of extra features and Includes many ES6 features.

To compile TypeScript we need something called the TypeScript Compiler to do that also called TSC which is included with the Angular CLI as well as the QuickStart

  Available variable Type in Typescript:

  • String
  • Number
  • Boolean
  • Array
  • Any
  • Void – Must be undefined
  • Null
  • undefined
  • Tuple – Specifc format for array like [string,number]

So, in this article we have covered some basic of typescript, if you like this article please comment and let me know if you want more advance tutorials. 

Conclusion:

Happy Coding! Thanks for reading.

Do let me know If you face any difficulties please feel free to comment below we love to help you. if you have any feedback suggestion then please inform us by commenting.

Subscribe to our Newsletter

Stay up to date! Get all the latest posts delivered straight to your inbox.

If You Appreciate What We Do Here On TutsCoder, You Should Consider:

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

You might also like

Leave a Comment