title: NodeJS pass variable to async callback function
body: <p>There is code that processes Prestashop API response in NodeJS where async callback function needs to use values from the time it was called. How to pass orderRows and i to .then() function in code below?</p>
  
  <pre><code>var orderRows = [1,2,3,4];
  for (var i = 0; i &lt; orderRows.length; i++) {
      prestan.get('combinations', {"id": orderId}).then(function (combinationsResponse) {
      var s=orderRows[i];
  </code></pre>