$.when.apply($, arrayOfPromises): Promise.all:
Promise.all(arrayOfPromises).then(function(arrayOfResults) {
});
Promise.all thenables , , . jQuery promises, , , thenables, .
Promise Promise shim/polyfill.
, :
var arrayOfPromises = [];
$('#piecesTable tr').not(':first').each(function(){
arrayOfPromises.push($.ajax({
}));
});
( $.map Array#map.)
:
Promise.all(arrayOfPromises).then(function(arrayOfResults) {
});