var someArray = [1,2,3],
i = someArray.length - 1;
// Reverse processing
jQuery.whileAsync({
delay: 100,
bulk: 0,
test: function() { return i >= 0 },
loop: function() {
// Do something with the array
i--;
}
});
// Forward processing
i = 0;
var len = someArray.length;
jQuery.whileAsync({
delay: 100,
bulk: 0,
test: function() { return i < len; },
loop: function() {
// Do something with the array
i++;
}
});