Compiling TypeScript

The TypeScript compiler can be installed via npm:

terminalnpm install -g typescript

After that, you can compile files written in TypeScript. These files should have the extension .ts. Let's make such a file:

app.tslet test: string = 'it works';
alert(test);

Let's compile it into a file with the same name, but with the extension .js. To do this, in the terminal, while in the folder with our file, run the command tsc:

terminaltsc app.ts

To get started with TypeScript faster, there is an online compiler. Try it out too.

Задание 1

Install TypeScript. Try compiling a test file.