Type Challenges Judge

Push

提出詳細

type Push<T extends ReadonlyArray<any>, K> = [...T, K]
提出日時2023-04-29 02:52:13
問題Push
ユーザーDowanna
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Push<[], 1>, [1]>>, Expect<Equal<Push<[1, 2], '3'>, [1, 2, '3']>>, Expect<Equal<Push<['1', 2, '3'], boolean>, ['1', 2, '3', boolean]>>, ]