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?
var orderRows = [1,2,3,4];
for (var i = 0; i < orderRows.length; i++) {
prestan.get('combinations', {"id": orderId}).then(function (combinationsResponse) {
var s=orderRows[i];