var a = [1,2,3,4,];
var b=["aa","bb"];
最终的结果是: [1,2,3,4,"aa","bb"]
- 方法1:concat
c=(b);
- 方法2:不使用新数组
for(var i=0;i<;i++){
(b[i]);
}
- 方法3:apply
(a,b);
- 方法4:es6的写法
(...b);
var a = [1,2,3,4,];
var b=["aa","bb"];
最终的结果是: [1,2,3,4,"aa","bb"]
c=(b);
for(var i=0;i<;i++){
(b[i]);
}
(a,b);
(...b);