apply

使用 apply 输出的是[“a”, “b”, “a”, “b”]

1
2
3
4
var a=["a","b"];
var b=["a","b"];
b.push.apply(a,b);
console.log(a);

push

使用 push 输出的是[“a”, “b”, Array(2)]

1
2
3
4
var a=["a","b"];
var b=["a","b"];
b.push(a);
console.log(b);