var arr = [5, 6, [1, 2], [3, 4]];
console.log(Array.prototype.concat.call([], arr)); // [5, 6, [1, 2], [3, 4]]
console.log(Array.prototype.concat.apply([], arr)); // [5, 6, 1, 2, 3, 4]
Last active
December 9, 2016 07:04
-
-
Save GeekaholicLin/72b123f436013d4072da46646e6e4390 to your computer and use it in GitHub Desktop.
call和apply参数的区别
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment