TypeScript is a JavaScript superset. It is not a new language. It takes JavaScript and adds new features and advantages to it. It makes writing JavaScript code easier and more powerful. It has one disadvantage: It cannot be executed by JavaScript environments like the browser. Also, Node.js can not execute TS. Now, how will this work. So, typescript is also a tool. You use it to compile your TS code to JS, which can be executed by JS environments.

Now, TS adds types to JS. So, it will prevent runtime errors. It also solves logical erros like:

Now, there are ways to do this in JS but it would be better if there were ways to do this during dev.
That is why we use typescript.
To install:
Make sure you have node.js and npm.
Now install ts using npm:

In the github repo find the 1-basic-proj in which there is a html and a JS file to add 2 numbers:
index.html:

js-only.js:

Output:
