Waiting for multiple deferred objects to complete
问题 When waiting for multiple deferred objects to complete, why does: $.when(tasks).then(function() { document.write("Completed all requests." + "<br/>"); }); execute immediately, yet $.when.apply(null, tasks).then(function () { document.write("Completed all requests." + "<br/>"); }); waits until the tasks have completed. 回答1: The when function does not take an array of deferreds. Rather, you pass each deferred as a separate argument. That's exactly what apply is doing for you. The null being