as 方式推断类型<> 指定类型点击查看【bilibili】 as 方式推断类型let anystr:any = "hello world"let strLength: number = (anystr as string).lengthconsole.log('len ',strLength) <> 指定类型 let strLen: number = (<string>anystr).length console.log('len2',strLen);