What's the meaning of “=>” in TypeScript? (Fat Arrow)

后端 未结 8 1923
心在旅途
心在旅途 2020-11-28 22:59

I just start to learn TypeScript, and I saw there is a lot of code using this sytax =>. I did some research by reading the Specification of TypeScript Versio

8条回答
  •  Happy的楠姐
    2020-11-28 23:40

    Directly from the link in OP:

    In this example, the second parameter to 'vote' has the function type

    (result: string) => any which means the second parameter is a function returning type 'any' that has a single parameter of type 'string' named 'result'.

提交回复
热议问题