ts多个泛型参数的函数

(() =>{
    function getMsg<K,V>(value1:K,value2:V) :[K,V]{
        return [value1,value2]

    }

    const arr1 = getMsg<string,number>('jack',100)
    console.log(arr1);
    console.log(arr1[0].split(''));
    
})()


posted @ 2021-04-07 11:42  前端那点事  阅读(134)  评论(0)    收藏  举报