キャストlet msg: any = "hello"; let len = (msg as string).length; let len2 = (<string>msg).length;
参考https://basarat.gitbooks.io/typescript/docs/types/type-assertion.html |
|
キャストlet msg: any = "hello"; let len = (msg as string).length; let len2 = (<string>msg).length;
参考https://basarat.gitbooks.io/typescript/docs/types/type-assertion.html |
|