Typescript offers type check at compile time as opposed to runtime. and this is the main benefit of using TypeScript.
Apart from strict typing, TypeScript introduces many other features like Interfaces, Mixin classes, Enums and more. We will discuss them later in another article.
Now let's set up typescript in your system so you can write and run some code.
Visit the link for more details. <https://nodejs.org/en/> To check if it is installed, type `node -v` in the console. It will show you the installed version.
npm install -g typescript
To check if it is installed, type
tsc-v in the console. It will show you the installed version.
Follow this link for other options
You can now be able to see main.ts and main.js files in your project folder where main.js is the transpiled version of the main.ts file.
So now we are at the end of the TypeScript basic introduction and setup part. In this article, we learned about the advantages of TypeScript, how it works behind the scene, how to set it up in your system, and how to write and run your first TypeScript code.
Also published here