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

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.

主站蜘蛛池模板: 白水县| 灌南县| 磐安县| 徐闻县| 松江区| 朝阳区| 大关县| 平顶山市| 锡林浩特市| 锦州市| 泾源县| 中方县| 勐海县| 武川县| 巨野县| 富源县| 栾城县| 义马市| 巩留县| 棋牌| 新巴尔虎右旗| 随州市| 青河县| 巫溪县| 阿坝县| 麻栗坡县| 徐水县| 岳西县| 安康市| 陕西省| 怀柔区| 夹江县| 汕头市| 云梦县| 永春县| 旌德县| 柳河县| 扎赉特旗| 汝州市| 高碑店市| 垫江县|