问题:
What is the difference between using call
and apply
to invoke a function? 使用call
和apply
来调用函数有什么区别?
var func = function() { alert('hello!'); };
func.apply();
vs func.call();
vs func.call();
Are there performance differences between the two aforementioned methods? 前述两种方法之间是否存在性能差异? When is it best to use call
over apply
and vice versa? 什么时候最好使用call
apply
,反之亦然?
解决方案:
参考一: https://stackoom.com/question/8Ksi/致电与申请之间有什么区别
参考二: https://oldbug.net/q/8Ksi/What-is-the-difference-between-call-and-apply
推荐阅读:生活中高情商表现的例子