js合并数组
2016-08-04 本文已影响41人
AdrianRD
方法一
使用concat合并数组
var mergeTo = [4,5,6];
var mergeFrom = [7,8,9];
var a = mergeTo.concat(mergeFrom);

方法二
var mergeTo = [4,5,6];
var mergeFrom = [7,8,9];
Array.prototype.push.apply(mergeTo, mergeFrom);
