疑问:TS

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);

猜你喜欢

转载自www.cnblogs.com/qq3279338858/p/12531999.html
ts