typescript demo step by step
This commit is contained in:
15
01_simple/Readme.md
Normal file
15
01_simple/Readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Для того что бы увидеть как typescript подсветит ошибку необходимо выполнить шаги:
|
||||
|
||||
1. Установка
|
||||
|
||||
```shell
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
2. Переименовываем файл
|
||||
|
||||
> index.js -> index.ts
|
||||
|
||||
3. Наблюдаем результат
|
||||
|
||||

|
||||
6
01_simple/index.ts
Normal file
6
01_simple/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
const square = { width: 10, height: 10 };
|
||||
|
||||
const check = () => console.log(square.width * square.heigth);
|
||||
|
||||
Reference in New Issue
Block a user