[Typescript] 75. Easy - Push
Implement the generic version of Array.push
For example:
type Result = Push<[1, 2], '3'> // [1, 2, '3']
/* _____________ Your Code Here _____________ */
type Push<T extends any[], U> = [...T, U]
/* _____________ Test Cases _____________ */
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]>>,
]