📜  ts 中的类 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:16.384000             🧑  作者: Mango

代码示例1
class Greeter {  greeting: string;
  constructor(message: string) {    this.greeting = message;  }
  greet() {    return "Hello, " + this.greeting;  }}
let greeter = new Greeter("world");Try