帶有泛型的 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?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章