首页 > 代码库 > push() & concat()

push() & concat()

eg.

var arr = [];arr.push(1);arr.push([2, 3]);arr.push(4, 5);arr = arr.concat(6);arr = arr.concat([7, 8]);arr = arr.concat(9, 10);for(var i=0; i<arr.length; i++){    console.log(arr[i]);}
View Code