const parts = [
[0, 1],
[0, 1, 2, 3],
[0, 1, 2],
[0, 1, 2, 3, 4, 5],
[0, 1, 2],
[0, 1, 2, 3],
[0, 1],
[0, 1, 2]
];
const result = parts.reduce((a, b) => a.reduce((r, v) => r.concat(b.map(w => [].concat(v, w))), []));
console.log(result.map(a => a.join(', ')));