jquery each leave early -


I have jQuery for each loop on an array and it is possible to leave the loop early.

$ (lines) .each (function (i) {// some code if (condition) {// I want something like a break;}});

break; does not really work for one reason

If I type a loop then it looks like that (but I do not want this):

 I = 0; i  

In advance thanks: Martin

according to:

If you want to break each () loop on a particular recurrence, then you can do this by misbehaving your function. Non-false returning is similar to an ongoing statement for a loop, it will immediately skip the next instance.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -