Unshift
提出詳細
type Unshift<T extends ReadonlyArray<any>, K> = [K, ...T]
提出日時 | 2023-04-29 02:52:59 |
---|---|
問題 | Unshift |
ユーザー | Dowanna |
ステータス | 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']>>, ]