Type Challenges Judge

Shift

提出詳細

type Shift<T extends unknown[]> = T extends [unknown, ...infer R] ? R : []
提出日時2023-09-01 09:16:04
問題Shift
ユーザーookkoouu
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Shift<[3, 2, 1]>, [2, 1]>>, Expect<Equal<Shift<['a', 'b', 'c', 'd' ]>, ['b', 'c', 'd']>>, ]