方案1
let arr1 = ['A1', 'A2', 'B1', 'B2', 'C1', 'C2', 'D1', 'D2']
let arr2 = ['A', 'B', 'C', 'D']
arr2 = arr2.map(v => `${v}3`);
let arr3=[...arr1, ...arr2].sort().map(v => v.replace('3', ''))
console.log(arr3)
方案2
let arr1 = ['A1', 'A2', 'B1', 'B2', 'C1', 'C2', 'D1', 'D2']
let arr2 = ['A', 'B', 'C', 'D']
let arr3=[]
while(arr1.length){
arr3.unshift(arr2.pop());
arr3.unshift(arr1.pop());
arr3.unshift(arr1.pop());
}
console.log(arr3)
方案3
let arr1 = ['A1', 'A2', 'B1', 'B2', 'C1', 'C2', 'D1', 'D2']
let arr2 = ['A', 'B', 'C', 'D']
let arr3 = []
let x, y, z;
while (arr1.length) {
[[x, y, ...arr1], [z, ...arr2]] = [arr1, arr2];
arr3.push(x, y, z);
}
console.log(arr3)