var tableMaker = (o,h) => {var keys = Object.keys(o[0]),
rowMaker = (a,t) => a.reduce((p,c,i,a) => p + (i === a.length-1 ? "<" + t + ">" + c + "</" + t + "></tr>"
: "<" + t + ">" + c + "</" + t + ">"),"<tr>"),
rows = o.reduce((r,c) => r + rowMaker(keys.reduce((v,k) => v.concat(c[k]),[]),"td"),h ? rowMaker(keys,"th") : []);
return "<table>" + rows + "</table>";
},
num = ["1", "2", "3"],
cars = ["Saab", "Volvo", "BMW"],
tdata = num.map((e,i) => [e,cars[i]]); // this is your 2D array.
table = tableMaker(tdata,false), // if second argument provided as truthy then headers are generated
document.write(table);