const arr = [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]];
const result = [];
for (let i = 0; i < arr.length; ++i) {
if (i % 2) {
for (let j = 0; j < 3; ++j) result.push(arr[i][j]);
} else {
for (let j = 2; j >= 0; --j) result.push(arr[i][j]);
}
}
console.log(result);
const result = arr.reduce((acc, n, i) => (
acc.push(...(i & 1 ? n : [...n].reverse())),
acc
), []);
for (let i = 0; i < arr.length; ++i) {
const a = i & 1 ? arr[i] : [...arr[i]].reverse();
for (let j = 0; j < a.length; ++j) {
result.push(a[j]);
}
}