title: Wait for completion after multiple promises in parallel using jQuery
body: <p>I want to queue multiple asynchronous ajax requests using deferred/promise implementation of jquery: </p>
  
  <pre><code>function doSomething() {
      console.log('doSomething')};
  
  function makeMultiAjaxRequests1() {
      console.log('makeMultiAjaxRequests1')};
  
  function makeMultiAjaxRequests2() {
      console.log('makeMultiAjaxRequests2')};
  
  var step1 = function () { 
      var promise = new $.Deferred().promise();   
      makeMultiAjaxRequests1(); 
      return promise; }
  
  var step2 = function () {
      var promise = new $.Deferred().promise();
      makeMultiAjaxRequests2();
      return promise; } 
  
  step1()
     .then(step2())
     .done(doSomething());
  
  $.when(step1(), 
         step2())
     .done(function () {
      doSomething();
  });
  </code></pre>
  
  <p>Here is the <a href="http://jsfiddle.net/zU6GA/" rel="noreferrer">fiddle link</a>. So my question is: </p>
  
  <p>In the pattern where step1 and step2 are executed in parallel, the code does not reach the last handler function. Why?</p>