I will try and let the code speak for itself here: what if condition can I use to check if there will be another iteration after the current one?
$('#%id% td').each(function(){
if(??????????){ // if there will be a next iteration
while($(this).height() == thisheight){
// do something here on this iteration, but only if there will be another.
}
}
});
Since it seems you want to process every element but the last one, you can simply remove the last element from the set, with
.slice[docs]:The answer to your original question would be to compare the current iteration against the number of elements: