- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 103字
- 2021-07-15 17:05:30
Any
The any data type is a dynamic data type that can hold any value. TypeScript throws compile time errors if you assign a string variable to an integer variable. If you are not sure about what value a variable is going to hold and you would like to opt out of compiler-checking for the type in the assignment, you can use the any data type:
var mixedList:any[] = [1, "I am string", false]; mixedList [2] = "no you are not";
Here, we used an array of the any type so that it can hold any type, such as numbers, strings, and booleans.
推薦閱讀
- Java程序設計(慕課版)
- Java EE 6 企業級應用開發教程
- Mastering Adobe Captivate 2017(Fourth Edition)
- Building a Game with Unity and Blender
- Instant 960 Grid System
- Learning AndEngine
- The DevOps 2.4 Toolkit
- Interactive Applications Using Matplotlib
- Learning DHTMLX Suite UI
- 深入淺出Serverless:技術原理與應用實踐
- 運用后端技術處理業務邏輯(藍橋杯軟件大賽培訓教材-Java方向)
- Angular開發入門與實戰
- Test-Driven Machine Learning
- Practical Maya Programming with Python
- Apache Solr for Indexing Data