# TypeScript

# 简介

什么是TypeScript?官网 (opens new window)这样介绍的,TypeScriptJavaScript的超集.

  • TypeScriptJavaScript类型的超集,它可以编译成纯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

# tsc hello.ts

hello world!
1
最后更新时间: 4/30/2021, 9:44:21 AM