問題:
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?