官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 湖南省| 大丰市| 北碚区| 宝鸡市| 水城县| 景谷| 洛浦县| 宁蒗| 汾阳市| 常山县| 嫩江县| 洛南县| 共和县| 西峡县| 长治县| 西昌市| 阳朔县| 长葛市| 逊克县| 廊坊市| 许昌市| 博乐市| 青岛市| 台东县| 临洮县| 双鸭山市| 青龙| 金寨县| 广南县| 北辰区| 汪清县| 巴青县| 兴和县| 临澧县| 太和县| 淮阳县| 班戈县| 麟游县| 山西省| 宣威市| 高尔夫|