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

Ts体操--unshift

zhuba-Ahhh opened this issue · comments

commented

实现类型版本的 Array.unshift

type Unshift<T extends unknown[], U> = [U, ...T];

type Result = Unshift<[1, 2], 0> // [0, 1, 2];