Typescript is unable to predict possible types for a variable indexed in an array

后端 未结 0 1148
渐次进展
渐次进展 2021-01-18 20:22

Example:

var x: (string | null) [] =  [];

for(var i=0; i<3; i++){
    x.push(prompt(\'Enter some string of click "cancel" to in         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题