Please see this minimum code below.
function zip<T>(...arrs: T[][]): T[][] {
return arrs
}
zip([1,2,3], ['a', 'b', 'c'])
// Type 'string' is not assignable to type 'number'.ts(2322)
zip<number | string>([1,2,3], ['a', 'b', 'c'])
// Ok, but a little bit bother to me.
I created a function using generics and rest properties.
When I directly use zip([1,2,3], ['a', 'b', 'c']), I expect that typescript automatically finds out I'm using number | string type, is there any way to achieve this?
