打字稿:使用对象将对象强制转换为其他类型.怎么样?和instanceof或typeof?

shi*_*vat 4 typescript

使用Typescript将对象转换为其他类型.怎么样?和instanceof或typeof?

Abo*_*odz 6

这样的事情: let object = myObject as string; // this way let object = <string> myObject; // or this way

但是, instanceof返回一个布尔值.typeof返回实例类型