Sunny-117 / js-challenges

✨✨✨ Challenge your JavaScript programming limits step by step

Home Page:https://juejin.cn/column/7244788137410560055

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

concat

FailurMan opened this issue · comments

//ts实现数组的concat功能
type Concat<T extends any[], U extends any[]> = [...T, ...U];
type Result = Concat<[1], [2]>;

个人觉得将any换成unknown会更严谨一些