# TypeScript
# 简介
什么是TypeScript?官网 (opens new window)这样介绍的,TypeScript是JavaScript的超集.
TypeScript是JavaScript类型的超集,它可以编译成纯JavaScript.TypeScript可以在任何浏览器,任何计算机和任何操作系统上运行,并且他是开源的.
# 安装TypeScript
npm install -g typescript
1
使用TypeScript其实很简单
tsc hello.ts
1
# Hello TypeScript
# hello.ts
function Hello(name:string){
return "hello"+name
}
let name="world!"
console.log(Hello(name))
1
2
3
4
5
2
3
4
5
# tsc hello.ts
hello world!
1
基本类型 →