阅读背景:

如何强制在Typescript中的所有变量声明一个类型

来源:互联网 

I understand that when you declare a variable in Typescript, you can choose whether or not to specify a type for the variable. If no type is specified, the default "any" type is used. Is there a way to force all variables to have a type declared, even if it may be "any". As in, I want a compiler error when a type isn't specified. This is so that programmers would be forced to give everything a type and prevent cases where variables are accidentally left as "any".I understand that when you declare a variable i




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: