What is TypeScript? [Typescript Tutorial]

What is TypeScript

What is TypeScript? It is defined as Microsoft’s new offer that changes the way JavaScript is written. From the word from it’s name Type, it associates solid typed layer in synergy with JavaScript. It supports object-oriented programming layer unlike with JavaScript.

What differs JavaScript?

JavaScript’s nature is known to be functional rather than strongly typed or object-oriented. For most of programmers that are used with defining interface and classes, declaring integers, string or other variables, they might have some difficulty adjusting. In JavaScript, enforcing those integrities can be challenging enough. But you could always declare objects through prototyping.

However, it is not said that JavaScript can’t enforce rules, it is achievable via custom code. The difference with TypeScript is you can write declarative code with enough integrity and enforcement. Let’s say you have a string that isn’t supposed to change, you can just set it to be with TypeScript. You can’t get that with JavaScript.

So should I stop using JavaScript completely?

We are not saying you stop using anything. TypeScript is not, in anyway, here to replace JavaScript. We also don’t think you should shrug off TypeScript and just stick to JavaScript. What do we recommend is to take the time to learn JavaScript as well as TypeScript to know when is the best time to use any of the two. TypeScript’s compiler runs through pure JavaScript thus, you still need to understand the relation between them.

TypeScript offers the lesser direct coding compared to JavaScript. It also lets you write code that JavaScript understands without the initiation requirements. If you’re in charge of leading a team, you may need these options like considering to use TypeScript to avoid more lines of code while still using JavaScript. Your team may have a preferred language but it may be worth giving TypeScript a chance to alleviate some of JavaScript’s weaknesses to realize its full power.

How to get started with TypeScript?

First, go to typescriptlang.org and find all sorts of ready to use tutorials, samples or downloads that may suit your needs. Let’s say you’re using Visual Studio, then you should download and install the TypeScript plugin.

Here is the TypeScript download page.

what is typescript

Once you’ve downloaded the plugin, install it with your Visual Studio. Once finished, verify the installation by typing tcs in your command prompt to run your TypeScript compiler.

what is typescript

Subscribe Now and Get our React Native Course for FREE!
Sign up now and have the latest tech tutorials delivered straight to your mailbox.

PLUS: Get FREE access to our React Native course, coming soon on Udemy!
We hate spam. Your email address will not be sold or shared with anyone else.