03060-easy-unshift
Easy
array

Array.unshift의 타입 버전을 구현하세요.

예시:

type Result = Unshift<[1, 2], 0> // [0, 1, 2]

Loading...
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']>>,
]