0% found this document useful (0 votes)
9 views

typescript

This TypeScript tutorial introduces TypeScript as a powerful superset of JavaScript, emphasizing its object-oriented features. It provides guidance on setting up the environment, including installing Node.js and the TypeScript compiler, and covers key concepts such as conditional statements and looping structures. The tutorial also outlines various topics related to TypeScript, including variables, functions, and object-oriented programming concepts.

Uploaded by

mathan raj.R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

typescript

This TypeScript tutorial introduces TypeScript as a powerful superset of JavaScript, emphasizing its object-oriented features. It provides guidance on setting up the environment, including installing Node.js and the TypeScript compiler, and covers key concepts such as conditional statements and looping structures. The tutorial also outlines various topics related to TypeScript, including variables, functions, and object-oriented programming concepts.

Uploaded by

mathan raj.R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

TypeScript Tutorial

TypeScript Tutorial

JavaScript is the name that many people hear in web development community, but JavaScript is a subset of one
of the powerful scripting language, which is TypeScript. TypeScript provides more powerful features like
classes, inheritance, etc., of object oriented programming.

TypeScript has come to light when Angular team developers has opted TypeScript for JavaScript for its rich
features.

Get Started with TypeScript

To work with typescript, NodeJS and TypeScript are required. You may use any text editor to create a .ts file
and use tsc command in cmd prompt to compile ts file to js file. One can also consider an IDE like Visual Studio
Code that could help write TypeScript with ease.

Install Node

Based on your OS version, you can download node from [https://nodejs.org/en/] and run the installer that
guides you through simple steps. To verify if node is installed, run node -v command in cmd prompt. node
command should echo the version of node that is installed.

Install TypeScript

With node installed, we get npm installed inclusively. Open a command prompt as administrator and run the
following command to install TypeScript compiler globally using npm :

npm install -g typescript


To verify if typescript is installed successfully, run tsc -v in command prompt from any folder location. It
should echo back the version of typescript being used as shown in the below screenshot.

TypeScript Tutorials

We are done with the environment setup for TypeScript. Now, we shall cover the different concepts in
TypeScript.

How to Run TypeScript Code?

In these series of TypeScript tutorials, we will compile the typescript code (.ts) files to JavaScript code (.js)
files. So you can run these JavaScript files using node command or you can also include this code in a html file
and run in a browser. While you have an option, in these tutorials, we will provide you the both the outputs from
a browser and node execution.

TypeScript Conditional Statements

Conditional statement executes a block of statement based on an expression’s value. The branching of this
execution can happen in many ways, and TypeScript provides statements for realizing this conditional
branching of execution flow :

Tutorial – TypeScript IF
Tutorial – TypeScript IF-ELSE
Tutorial – TypeScript SWITCH

TypeScript Looping Statements

Often it is required to execute a task repeatedly based on a condition. TypeScript provides for, while and do-
while to execute looping program structures.

Tutorial – TypeScript FOR


Tutorial – TypeScript WHILE
Tutorial – TypeScript DO WHILE
Conclusion

In this TypeScript Tutorial, we have learnt what TypeScript is, what are its advantages over JavaScript, and
setup the environment for TypeScript Application development.

TypeScript

➩ TypeScript Tutorial

✦ TypeScript Variables

✦ TypeScript if

✦ TypeScript if-else

✦ TypeScript Switch

✦ TypeScript For Loop

✦ TypeScript While Loop

✦ TypeScript Do-While Loop

✦ TypeScript Arrays

✦ TypeScript Tuples

✦ TypeScript Unions

✦ TypeScript Functions

✦ TypeScript Anonymous Functions

TypeScript Object Oriented Concepts

✦ TypeScript Class

✦ TypeScript Inheritance

✦ TypeScript Method Overriding

✦ TypeScript Interface

TypeScript String Operations

✦ TypeScript String Length

✦ TypeScript String Split

You might also like