方法一
使用concat合并數(shù)組
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);
使用concat合并數(shù)組
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);