tutorialsnest typescript

TypeScript Variables

TypeScript follows the same rules as JavaScript for variable declarations. TypeScript variables can be declared using: var, let, and const. Var Similar to JavaScript, we can declare variables in TypeScript using the var keyword. The scoping rules also remain the same as in JavaScript. Let The let declarations follow the same syntax as var declarations. Unlike variables …

TypeScript Variables Read More »

TypeScript Hello World

TypeScript Hello World Console Now that we have installed TypeScript successfully, Let’s start with our first typescript program – TypeScript Hello World. Open any editor of your choice and type the code given below: File: helloworld.ts function greeting(input){ return “Hello, ” + input; } let message = “World”; console.log(greeting(message)); The typescript code would be transpiled …

TypeScript Hello World Read More »

TypeScript Installation

TypeScript  Installation There are two ways to install typescript: Using npm (Node Package Manager) Install the TypeScript plugin in your IDE ✅ Install typescript using npm You must have node.js installed on your machine. If you don’t have it installed, you can install it from here. Now, to install typescript just head over to the command …

TypeScript Installation Read More »