“any” in Typescript

后端 未结 4 1593
不知归路
不知归路 2021-01-20 15:10

I am beginner in typescript. I have a doubt in usage of \"any\" type.

Using \"any\" is basically opting out type checking if I am right. For example

4条回答
  •  轮回少年
    2021-01-20 16:07

    Any: any type. Used when impossible to know the type. When you declare type as any, you can reassign any type of value in that variable.

    var num:any = 12;
    num = boolean;
    num = "abcd"
    

提交回复
热议问题