xcatliu / typescript-tutorial

TypeScript 入门教程
https://ts.xcatliu.com
10.44k stars 1.33k forks source link

Any类型章节有误 #99

Open lamborghini1993 opened 4 years ago

lamborghini1993 commented 4 years ago

let anyThing: any = "any"; console.log(anyThing.myName); // console.log(anyThing.myName.firstName); // anyThing.setName("Jerry"); // anyThing.setName("Jerry").sayHello(); // anyThing.myName.setFirshName("Cat");

后四句都会报错