使用call和apply来调用函数有什么区别? 
var func = function() {
  alert('hello!');
}; func.apply(); vs func.call(); 
上述两种方法之间是否存在性能差异?什么时候最好使用call over apply ,反之亦然? 
不同之处在于apply允许您使用arguments作为数组调用函数; call需要显式列出参数。一个有用的助记符是“ A for a rray and C for c omma。” 
伪语法:
 theFunction.apply(valueForThis, arrayOfArgs) 
 theFunction.call(valueForThis, arg1, arg2, ...) 
从 ES6 开始,还可以spread阵列以便与call函数一起使用,您可以在这里看到兼容性。 
示例代码:
function theFunction(name, profession) {
    console.log("My name is " + name + " and I am a " + profession +".");
}
theFunction("John", "fireman");
theFunction.apply(undefined, ["Susan", "school teacher"]);
theFunction.call(undefined, "Claude", "mathematician");
theFunction.call(undefined, ...["Matthew", "physicist"]); // used with the spread operator要回答关于何时使用每个函数的部分,如果您不知道要传递的参数的数量,或者它们是否已经在数组或类似数组的对象中(如arguments转发自己的对象),请使用apply参数。否则使用call ,因为不需要将参数包装在数组中。 
f.call(thisObject, a, b, c); // Fixed number of arguments
f.apply(thisObject, arguments); // Forward this function's arguments
var args = [];
while (...) {
    args.push(some_value());
}
f.apply(thisObject, args); // Unknown number of arguments当我没有传递任何参数时(比如你的例子),我更喜欢call因为我正在调用函数。 apply意味着你将函数应用于(不存在的)参数。 
应该没有任何性能差异,除非您使用apply并将参数包装在数组中(例如f.apply(thisObject, [a, b, c])而不是f.call(thisObject, a, b, c) )。我没有测试它,所以可能会有差异,但它将是非常浏览器特定的。如果你没有数组中的参数,那么call可能会更快,如果你这样做,则apply更快。