I know this sounds like a bad idea but is there a way to stop a loop from looping until a condition has been met in javascript.
I'm using underscores .each loop:
foobar.each(function (foo)
Is there way to only loop to the next element when a condition has been met? otherwise wait at the end.
The reason for this is that I'm retrieving data from URL's in the loop. The URL updates on the condition. And unless the loop waits it will renter the loop with the same URL. Therefore, I'll get the same data twice.