YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* キャスト [#w07a1280]
let msg: any = "hello";
let len = (msg as string).length;
let len2 = (<string>msg).length;
- JSXで使う場合は<string>だとまずいので、asを使うらしい
** 参考 [#u03fdc02]
https://basarat.gitbooks.io/typescript/docs/types/type-as...
終了行:
* キャスト [#w07a1280]
let msg: any = "hello";
let len = (msg as string).length;
let len2 = (<string>msg).length;
- JSXで使う場合は<string>だとまずいので、asを使うらしい
** 参考 [#u03fdc02]
https://basarat.gitbooks.io/typescript/docs/types/type-as...
ページ名: