title: jQuery when/then/fail with concurrent ajax requests: Which request failed?
body: <p>Imagine a scenario where we want to do something after the concurrent requests for 'foo' and 'bar' have completed successfully, or report an error if one or both of them fails:</p>
  
  <pre><code>$.when($.getJSON('foo'), $.getJSON('bar'))
    .then(function(foo, bar) {
      console.log( 'I fire if BOTH requests are successful!' );
    })
    .fail(function() {
      console.log( 'I fire if one or more requests failed.' );
    });
  </code></pre>
  
  <p>How can I determine if 1) the request for 'foo' failed, or 2) the request for 'bar' failed, or 3) if both failed? </p>