title: $.when promise is resolving too early
body: <p>I'm wondering why $.when is resolving too early?
  I need it to resolve only when all the others promises have resolved.
  Am I missing something?</p>
  
  <p>Update: <a href="http://jsfiddle.net/7hdx5j6z/6/" rel="nofollow">http://jsfiddle.net/7hdx5j6z/6/</a></p>
  
  <pre class="lang-js prettyprint-override"><code>  var promises = []
  
    localforage.iterate(function(value, key) {
      if ( key.indexOf('params_') === -1 ) {
        promises.push(localforage.removeItem(key))
        console.log(promises)
      }
    })
  
    $.when.apply($, promises).then(function() {
      console.log('all done!')
    })
  </code></pre>