Typescript syntax for generic (but non-union) string as key in object

前端 未结 0 1258
走了就别回头了
走了就别回头了 2021-02-05 13:53

My use case is roughly (and this is invalid syntax):

function Foo(key : KeyT, data: {[key]?: Something}) { 
   if(!data[key]){
       /         


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