Appearance
题目
Implement the type version of Array.shift
Array.shift
For example
type Result = Shift<[3, 2, 1]>; // [2, 1]
解答
type Shift<T extends unknown[]> = T extends [infer _, ...infer Rest] ? [...Rest] : T;