DDR爱好者之家 Design By 杰米

这里简单地讲两种方法:
第一种  

var mergeTo = [4,5,6], 
   mergeFrom = [7,8,9]; 
 
mergeTo = mergeTo.concat(mergeFrom); 
mergeTo; // is: [4, 5, 6, 7, 8, 9] 

  or  

var a = [1,2], b = [3,4], c = a.concat(b); 
 

 
第二种 

var mergeTo = [4,5,6], 
var mergeFrom = [7,8,9]; 
 
Array.prototype.push.apply(mergeTo, mergeFrom); 
 
mergeTo; // is: [4, 5, 6, 7, 8, 9] 

合并多个数组merge array:

// 特殊处理业务-必须启用 
var _SPECIAL_MUST_ENABLE_LIST = ['intime']; 
 
if(termNo != null && termNo.indexOf("9966") == 0){ 
  var newMustEnableList = ['mobile','psp','jtk','credit','train','bank','alipay','lottery','movie','littleTransfer', 
               'trafficFines','concert','mall','airplane','hotel','recycle']; 
  _SPECIAL_MUST_ENABLE_LIST = _SPECIAL_MUST_ENABLE_LIST.concat(newMustEnableList); 
} 

DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米