Type Challenges Judge

Pop

提出詳細

type Pop<T extends any[]> = T extends [...infer L, infer R] ? L : []
提出日時2023-08-07 17:19:05
問題Pop
ユーザーookkoouu
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Pop<[3, 2, 1]>, [3, 2]>>, Expect<Equal<Pop<['a', 'b', 'c', 'd' ]>, ['a', 'b', 'c']>>, ]