https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
TypeScript in 5 minutes
Compiling your code(编译代码)
tsc greeter.ts // 返回 greeter.js 文件
- Add a : string type annotation to the ‘person’ function argument as shown here(为 person 添加类型注释)
function greeter(person: string) {
return "Hello, " + person;
}
let user = "Jane User";
document.body.textContent = greeter(user);