Ts体操--push
zhuba-Ahhh opened this issue · comments
实现在类型系统里通用的 Array.push
type Push<T extends unknown[], U> = [...T, U];
type Result = Push<[1, 2], '3'> // [1, 2, '3'];
✨✨✨ Challenge your JavaScript programming limits step by step
zhuba-Ahhh opened this issue · comments
实现在类型系统里通用的 Array.push
type Push<T extends unknown[], U> = [...T, U];
type Result = Push<[1, 2], '3'> // [1, 2, '3'];