求大佬详细说下下面代码的运行机制。
(这让我想到了好像以前就是利用apply来实现es6里面的...运算符?)
// `b` onto `a`:
a.push.apply( a, b );
a; // [1,2,3,4,5,6,7,8,9,"foo","bar","baz","bam","bun","fun"]
// or `a` into `b`:
b.unshift.apply( b, a );
b; // [1,2,3,4,5,6,7,8,9,"foo","bar","baz","bam","bun","fun"]
UYOU
相关分类