带有泛型的 Typescript 箭头函数的语法是什么? - What is the syntax for Typescript arrow functions with generics?

问题:

The typescript handbook currently has nothing on arrow functions.打字稿手册目前没有关于箭头函数的内容。 Normal functions can be generically typed with this syntax: example:可以使用以下语法对普通函数进行一般类型化:例如:

function identity<T>(arg: T): T {
    return arg;
}

What is the syntax for arrow functions?箭头函数的语法是什么?


解决方案:

参考一: https://stackoom.com/question/2BYsk
参考二: What is the syntax for Typescript arrow functions with generics?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章