cartesianProduct(['a', 'b'], [1, 2]) // β [['a',1], ['a',2], ['b',1], ['b',2]]cartesianProduct generates all ordered pairs combining one element from each array.
Challenge: Implement cartesianProduct<T, U>(a: T[], b: U[]): [T, U][] generating all combinations.
cartesianProduct([1,2], ['a','b'])
// β [[1,'a'],[1,'b'],[2,'a'],[2,'b']]