Hello DEVs so excited to publish my very first post on dev.to
Let's get to it.
easy to use without switching development tools.
TypeScript provides many advantages for client-side developers. We are going to look at some reasons why you should use TypeScript.
- TypeScript is simple, fast, and easy to learn since it is not an entirely new language.
- TypeScript is statically typed, therefore code written in TypeScript is more predictable, and is generally easier to debug.
- TypeScript supports OOP features like classes, inheritance, interfaces, generics etc.
- TypeScript provides compile time error-checking.
- TypeScript tooling provides autocompletion, type checking and source code documentation.
To start a project with TypeScript, you need to have TypeScript installed and this is possible with the Node Package Manager, NPM. NPM must be installed and it comes free with the installation of NodeJS.
After installing NPM, write the following command in your Terminal / Command Prompt / Powershell to install TypeScript globally.
npm install -g typescript
This will make the TypeScript compiler available for all your projects.
Type in the following command to test that TypeScript was installed successfully.
If the installation was successful, you should see a version number similar to the one below.
Visual Studio Code includes TypeScript language support automatically. Because we already installed the TypeScript compiler, all we need to do is install VSCode.
- Point your browser to the Visual Studio Code downloads page.
- Choose a download based on your operating system and install VSCode once the download has finished.
If you’re having trouble installing VSCode, please see the official documentation for help.