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

后端 未结 8 1934
心在旅途
心在旅途 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条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 23:50

    var MakePoint: () => {  
        x: number; y: number;  
    };
    

    MakePoint is a variable. It's type is a function that takes no arguments and produces numbers x and y. Now does the arrow make sense?

提交回复
热议问题