Co robi $ .when.apply ($, someArray)?

Jestemczytanie o odroczeniach i obietnicach i ciągle napotykaj$.when.apply($, someArray). Jestem trochę niejasny, co dokładnie robi, szukając wyjaśnieniajedna linia działa dokładnie (nie cały fragment kodu). Oto kontekst:

var data = [1,2,3,4]; // the ids coming back from serviceA
var processItemsDeferred = [];

for(var i = 0; i < data.length; i++){
  processItemsDeferred.push(processItem(data[i]));
}

$.when.apply($, processItemsDeferred).then(everythingDone); 

function processItem(data) {
  var dfd = $.Deferred();
  console.log('called processItem');

  //in the real world, this would probably make an AJAX call.
  setTimeout(function() { dfd.resolve() }, 2000);    

  return dfd.promise();
}

function everythingDone(){
  console.log('processed all items');
}

questionAnswers(7)

yourAnswerToTheQuestion