How can I write SelectMany, which is a Linq function in C#, to do the same in TypeScript language.
For Example, The output of the sample code is as follows:
string[] letter = { "a", "b", "c" };
int[] number = { 1, 2, 3 };
var result = letter.SelectMany(x => number, (x, y) => (x + y));
result = a1, a2, a3, b1, b2, b3, c1, c2, c3
How can I write the typescript equivalent of this code. I try this but it doesn't work.
const result = letter.reduce((x, y) => [...x, ...y], number);
Can you help me, Thanks.