title: Promises in Series are not getting executed in sequence
body: <p>I have written the code based on the Parse example provided in Parse.com to execute the promises in Series. </p>
  
  <p>But, seems like sequential processing is not working fine.</p>
  
  <p>The below code calls a cloud function namely 'sampleCloudFuction' multiple times but in sequential order through Series of Promises. </p>
  
  <p>After executing the loop, app will make a call to another js function which will load the remaining items (excluding the processed items).</p>
  
  <p><strong>This is the Loop which make multiple calls to the cloud function:</strong></p>
  
  <pre><code>var seriesPromise = new Parse.Promise.as();
  
   $.each(items, function (i) {
                  ..
                  ..
  
                  count++;
                  if (count &gt;= 25 || (i + 1) &gt;= selectedItemsLength) {
  
                      .. ..
  
  //Series Promise: The code to be executed in sequence being placed within the 
  //then() the existing promise
  
                      seriesPromise = seriesPromise.then(function () {
                          Parse.Cloud.run('sampleCloudFuction', itemsArray, function () {
                              console.log("success callback in JS");
                              var tempPromise = Parse.Promise.as();
                              return tempPromise;
  
  
                          }, function (error) {
                              alert("Error " + error.code + "::");
                              console.log("error callback in JS")
                          });
                      });
  
                      count = 0;
  
  
                  }
              });
  
  ..
  ..
  
  
  seriesPromise.then(function () {
                  //Fetch the approval state of the disabled button
                  alert("load remaining items");
  
              });
  </code></pre>
  
  <p><strong>The below function is to be called after executing the loop.</strong> But, this is being called well in before receiving the callbacks for all earlier requests.</p>
  
  <pre><code>seriesPromise.then(function () {
              //Fetch the approval state of the disabled button
              alert("load remaining items");
  
          });
  </code></pre>