There is a modern saying in JS development -> for .. loops are for the noobs. I forgot to tell you about the new trend. Actually this trend is the reason why I could not explain you those decremental loops you are using.
Try to use $.each(array, function (index, value) {
...
}); 
instead. This type of calls is very optimized. It does not have length attribute and every single call will be executed in a closure.
Just read extra docs online on how to break from the callback. I think it is achieved by calling return false;