title: adding promises to an array of promises in a for loop
body: <p>let's assume the following example:</p>
  
  <pre><code>var bb = require('bluebird');
  
  var promiseStack = [];
  var deferred = bb.defer();
  
  promiseStack.push(deferred.promise);
  
  bb.delay(2500).then(function() {
      deferred.resolve();
  });
  
  bb.all(promiseStack).then(function() {
      console.log('done');
  });
  </code></pre>
  
  <p>Why isn't it possible to do the following:</p>
  
  <pre><code>var bb = require('bluebird');
  
  var promiseStack = [];
  
  
  for(var i = 1; i &lt; 10; i++) {
      var deferred = bb.defer();
      promiseStack.push(deferred.promise);
  
      bb.delay(2500).then(function() {
          deferred.resolve();
      });
  }
  
  bb.all(promiseStack).then(function() {
      console.log('done');
  });
  </code></pre>
  
  <p>It takes aprox. 2500ms but <code>console.log('done')</code> isn't called.
  What's the problem with, am I doing wrong?</p>
  
  <p>The best,
  redshark1802</p>