JavaScript
Article
By Sam Deering

jquery (js) skip out of each loop

By Sam Deering

Quick JavaScript snippet to skip out of each loop. Returning true skips to the next iteration, equivalent to a continue in a normal loop.

--ADVERTISEMENT--

..inside loop such as foreach, $.each or .each etc...
if (condition){
   return false
}
....
Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account