Type Challenges Judge

Unshift

提出詳細

type Unshift<T extends readonly unknown[], U> = [U, ...T]
提出日時2023-09-13 02:09:34
問題Unshift
ユーザーsankantsu
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Unshift<[], 1>, [1]>>, Expect<Equal<Unshift<[1, 2], 0>, [0, 1, 2 ]>>, Expect<Equal<Unshift<['1', 2, '3'], boolean>, [boolean, '1', 2, '3']>>, ]