这里简单地讲两种方法: 第一种
mergeTo = mergeTo.concat(mergeFrom);
mergeTo; // is: [4,6,7,9]
mergeTo; // is: [4,6,7,9]
or
第二种
Array.prototype.push.apply(mergeTo,mergeFrom);
mergeTo; // is: [4,9]
合并多个数组merge array:
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);
}
原文链接:https://www.f2er.com/js/49780.htmlvar 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);
}