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

  • 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.

主站蜘蛛池模板: 瓦房店市| 寿宁县| 鹤岗市| 潜江市| 澜沧| 广丰县| 高淳县| 兴仁县| 建阳市| 台南市| 年辖:市辖区| 武安市| 建宁县| 西平县| 思南县| 曲周县| 澜沧| 碌曲县| 托克逊县| 志丹县| 勐海县| 资兴市| 六盘水市| 金阳县| 湘阴县| 同德县| 丽水市| 梅河口市| 应用必备| 平罗县| 怀宁县| 张掖市| 亳州市| 宣威市| 介休市| 云阳县| 葵青区| 莱州市| 金塔县| 康平县| 昌邑市|