//ES5合并数组
var arr = [12,true,5];
var arrCont = [1,6,66].concat(arr);
console.log(arrCont);//[1, 6, 66, 12, true, 5]
//ES6
var arr = [12,true,5];
var arrList = [35,66,34,...arr];
console.log(arrList);//[35, 66, 34, 12, true, 5]
原文地址:https://www.cnblogs.com/whlBooK/p/10340915.html
时间: 2024-10-12 02:07:15