title: $.when.apply not working when one of the promises in the array of promise is deferred
body: <p>I have an array which stores promises returned from different functions . I have used   </p>
  
  <pre><code>_.each(someDiffArray,function(element){ 
         var promise = renderSomething(); 
         promiseArray.push(promise);
    } 
  </code></pre>
  
  <p>where renderSomething returns deferred promise sometimes.  </p>
  
  <pre><code>$.when.apply($, promiseArray).done(function() {
      //doSomething
  });
  </code></pre>
  
  <p>But when one or more of the promises in <code>promiseArray</code> is deferred and it is resolved and other promises have yet to be done or resolved control is going inside the callback function of <code>$.when.apply</code>.</p>
  
  <p>I dont know why this is happening , can somebody help? Is it because of the behavior of deferred or is there some other problem?</p>