例如:
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)
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。