TS是JS的超集
定义变量
let age:number = 18;
let age = 18;
安装解析TS插件然后把TS解析成JS
npm i -g typescript
tsc hello.ts
node hello.js
//简化
npm i -g ts-node
ts-node hello.ts
TS是JS的超集
let age:number = 18;
let age = 18;
npm i -g typescript
tsc hello.ts
node hello.js
//简化
npm i -g ts-node
ts-node hello.ts