Argument of type 'X' is not assignable to parameter of type 'X'

前端 未结 9 1938
名媛妹妹
名媛妹妹 2021-02-02 05:15

Good day. I\'m new to Type Script, using VSCode.

Getting following errors:

  1. error TS2322: Type \'() => string\' is not assignable to type

9条回答
  •  不知归路
    2021-02-02 05:55

    You miss parenthesis:

    var value: string = dataObjects[i].getValue(); 
    var id: number = dataObjects[i].getId();
    

提交回复
热议问题