Concat
Implement the JavaScript Array.concat function in the type system. A type takes the two arguments. The output should be a new array that includes inputs in ltr order
For example:
tstypeCannot find name 'Concat'.2304Cannot find name 'Concat'.Result =<[1], [2]> // expected to be [1, 2] Concat
tstypeCannot find name 'Concat'.2304Cannot find name 'Concat'.Result =<[1], [2]> // expected to be [1, 2] Concat
Solution ✅
tstypeConcat <A extends any[],B extends any[]> = [...A , ...B ]typeResult =Concat <[1], [2]> // expected to be [1, 2]
tstypeConcat <A extends any[],B extends any[]> = [...A , ...B ]typeResult =Concat <[1], [2]> // expected to be [1, 2]