JSFiddle - React, Tailwind, and code Playground
JavaScript
var table1 =["lo","ly"];
var table2 = ["ly","lo"];
var table3 = ["qa","aq"];
var tabler = [table1,table2,table3];
function composer(x,y){
var newTable = [];
x.forEach(function(itemX){
y.forEach(function(itemY){
newTable.push(itemX + " " + itemY);
})
})
return newTable;
}
while(tabler.length >1){
tabler[0] = composer(tabler.shift(),tabler[0]);
}
console.log(tabler);