【TypeScript】十四、泛型
interface Add {
    
}

function add<T>(a: T, b: T): T[] {
    return [a, b]
}

let res = add<number>(1, 2)
console.log(res)

posted on 2022-07-05 18:43  仓鼠不爱吃辣条  阅读(33)  评论(0)    收藏  举报

页尾

页尾

页尾

页尾

页尾

页尾

页尾