function echo(arg:any):any{
return arg
}
const result=echo(123)
function echo<T>(arg:T):T{
return arg
}
const result1=echo(123)
function swap<T,U>(tuple:[T,U]):[U,T]{
return [tuple[1],tuple[0]]
}
const result=swap(['string',123])
标签:function,15,tuple,echo,123,react18,arg,泛型,return
From: https://www.cnblogs.com/yao-655442/p/16629132.html