2021年6月29日

class

摘要: 最简单的类 class Person { name: string //定义实例属性 age: number = 20 // 定义实例属性并且赋值 constructor(name: string) { this.name = name //实例属性赋值 } run(): void { consol 阅读全文

posted @ 2021-06-29 16:20 章画 阅读(188) 评论(0) 推荐(0) 编辑

type 关键字

摘要: type常用用法 type words = (word: string) => string //type 定义函数类型1 type AddtionType={(a:number,b:number):number} //type 定义函数类型2 很像接口是不是 type methodType = ' 阅读全文

posted @ 2021-06-29 13:48 章画 阅读(288) 评论(0) 推荐(0) 编辑

导航