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

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.

主站蜘蛛池模板: 澎湖县| 海阳市| 宜宾市| 罗城| 龙海市| 滁州市| 革吉县| 章丘市| 保亭| 余姚市| 新宾| 南部县| 杭锦旗| 民乐县| 会昌县| 萨嘎县| 宁化县| 玛多县| 宁津县| 岫岩| 清水河县| 安西县| 登封市| 武城县| 固始县| 福贡县| 晋江市| 惠水县| 手机| 长白| 囊谦县| 汝城县| 馆陶县| 永胜县| 南充市| 武宁县| 绥棱县| 汉寿县| 泗阳县| 英山县| 湘西|