随笔分类 -  TypeScript

摘要:联合类型和类型保护 联合类型 | // 联合类型和类型保护 interface Bird { fly: boolean sing: () => {} } interface Dog { fly: boolean bark: () => {} } //联合类型 function trainAnial( 阅读全文
posted @ 2021-12-09 15:41 纯、臻 阅读(53) 评论(0) 推荐(0)
摘要:基础类型 null undefined symbol boolean void const count: number = 123; const teacher: string = "zhen"; 对象类型 //对象类型 // 对象 const teacher: { name: string; ag 阅读全文
posted @ 2021-12-06 01:31 纯、臻 阅读(42) 评论(0) 推荐(0)