typescript array of object error on missing type

后端 未结 0 475
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 13:13

I have no clue why my IDE prompt a type error

interface test {
    id: number
}[]

const testData: test = [{id:1}, {id: 2}] //Property \'id\' is missing in ty         


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