var array= [1,2,3,4];
array.push(5)
console.log(array) //[ 1, 2, 3, 4, 5 ]
它会把追加的数组作为元素的某一项添加到末尾
array.push([6,7])
console.log(array)//[ 1, 2, 3, 4, [ 6, 7 ] ]
var array2 = array.concat([7,8])
console.log(array2 )//[ 1, 2, 3, 4, 7, 8 ]
var a = []
var b = [{"a":1},{"b":2}]
a.push.apply(a,b);
console.log(a)// [{"a":1},{"b":2}]
var a1 = [1,2]
var a2 = [3,4]
a1.push.apply(a1,a2);
console.log(a1)//[1,2,3,4]