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体操--push

zhuba-Ahhh opened this issue · comments

commented

实现在类型系统里通用的 Array.push

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

type Result = Push<[1, 2], '3'> // [1, 2, '3'];