例如:
let a=[1,2,3];
let b=[4,5,6]
第一种方法
let c = a.concat(b);
第二种方法
for(let i in b){
a.push(b[i])
}
第三种办法
a.push.apply(a,b);
第四种办法
var newA = [...a,...b];console.log(newA)
例如:
let a=[1,2,3];
let b=[4,5,6]
第一种方法
let c = a.concat(b);
第二种方法
for(let i in b){
a.push(b[i])
}
第三种办法
a.push.apply(a,b);
第四种办法
var newA = [...a,...b];console.log(newA)
相关文章: