function foo<T1, T2>(a: T1, b: T2): [T1, T2] { return [a, b] } let res = foo<string, number>('str', 777) let res1=foo<number,string>(777,'str')