Typescript is microsoft’s extension of javascript. it provides type checking abilities and also has features of object oriented programming. typescript is used in both angular2 and ionic2.typescript has similar syntax and semantics that are used in javascript by developers.installing typescriptyou can install typescript tools in two ways:by npm (the node.js package manager)by installing visual studio plugins of typescriptrun the following command to install typescript:npm install -g typescriptbuild typescript file:write the following code in your text editor and save it as hello.ts :function hello(name) { return "hello, " + name;}var user = user name;document.body.innerhtml = hello(user);compile the code:run this typescript compiler tsc greeter.tstsc hello.tsit will create a greeter.js file with the same javascript code that is written in ts file.type annotations:there are some ways in typescript that can be used to record the intended contract of the variable or function. here, we are passing string as a parameter in hello function:function hello(name: string) { return "hello, " + name;}var user = user name;document.body.innerhtml = hello(user);here we have added :string type annotation to hello function as argument.running your typescript web app:now create a html file hello.html with the below code and run it in browser to see the result.