- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 72字
- 2021-07-15 17:05:31
Array type interfaces
We can also define an interface for array types. We can specify the data type for the index array and the data type to the array item as follows:
interface CutomerNameArray { [index: number]: string; } var customerNameList: CutomerNameArray; customerNameList = ["Rajesh", "Gunasundaram"];
TypeScript supports two types of index: number and string. This array type interface also stipulates that the return type of the array should match the declaration.
推薦閱讀
- GAE編程指南
- Visual Basic程序開發(學習筆記)
- 控糖控脂健康餐
- 編程珠璣(續)
- Java加密與解密的藝術
- Java深入解析:透析Java本質的36個話題
- PySide GUI Application Development(Second Edition)
- Android Native Development Kit Cookbook
- Ext JS 4 Web Application Development Cookbook
- Oracle 18c 必須掌握的新特性:管理與實戰
- Android Game Programming by Example
- Unity 5.X從入門到精通
- OpenCV Android Programming By Example
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)
- Python網絡爬蟲實例教程(視頻講解版)