- 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.
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- ASP.NET Core:Cloud-ready,Enterprise Web Application Development
- Python概率統計
- R語言經典實例(原書第2版)
- SpringMVC+MyBatis快速開發與項目實戰
- Mastering Python Scripting for System Administrators
- Java程序設計與實踐教程(第2版)
- Python機器學習經典實例
- SQL基礎教程(第2版)
- Mastering Business Intelligence with MicroStrategy
- 軟件項目管理實用教程
- Django 3.0應用開發詳解
- After Effects CC案例設計與經典插件(視頻教學版)
- Flink入門與實戰
- Hadoop Blueprints