I have a code like this :
for(var i=0; i<data.length; i++)
{
  promise.when(firstoperation()).then(function(){
  Need to use data[i] here.
 });
}
Its a nested asynchronous function, is there anyway to pass the data to it? without making the data global??
