
var arr = [
["a", "b"],
["1", "2"],
["d"]
];
var sarr = [
[]
];
for (var i = 0; i < arr.length; i++) {
var tarr = [];
for (var j = 0; j < sarr.length; j++)
for (var k = 0; k < arr[i].length; k++)
tarr.push(sarr[j].concat(arr[i][k]));
sarr = tarr;
}
alert(sarr.join("\n"));