摘要: 一、交叉类型(&): 将多个类型合拼在一起 1 // 示例1 2 type I0 = {TOP:"TOP"};//使用type声明的字面量类型 3 interface I1 { 4 name:string 5 sleep:()=>void 6 } 7 interface I2 { 8 name:st 阅读全文
posted @ 2020-08-24 18:11 天高任鸟飞吧 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 一、number:数字类型 包括十进制的整数,浮点数,八进制和16 进制的数 1 let num:number = 1 // 指定number 2 let num2 = <number>1;//使用断言写法 3 let num3 = 1 as number;//使用断言写法 4 let num4 = 阅读全文
posted @ 2020-08-24 18:10 天高任鸟飞吧 阅读(260) 评论(0) 推荐(0) 编辑