I have this below response
Response
const result = [
  {
    Id: "1",
    Char1: "a; b; c",
    Char2: "d; e; f"
  }
];
Currently I am generating output like below from my below JS code
Id,Char1,Char2
1,a,d
1,b,e
1,c,f
But I want to generate output like below with all combination of Char1 and Char2 with rest of the data-
Id,Char1,Char2
1,a,d
1,a,e
1,a,f
1,b,d
1,b,e
1,c,f
1,c,d
1,c,e
1,c,f
JS -
result
    .reduce((acc, {
        Id,
        Char1,
        Char2
    }) => {
        const a = Char1.split(";");
        const c = Char2.split(";");
        a.forEach((item, index) => {
            acc.push({
                Id: Id,
                Char1: item,
                Char2: c[index]
            });
        });
        return acc;
    }, [])
    .forEach(item => {
        lines.push(rowData.map(key => item[key]).join(","));
    });
 
     
     
     
    