Each function in jquery is handy, and the $.each () function encapsulates a very powerful traversal function that traverses one-dimensional arrays, multidimensional arrays, DOM, JSON, and so on.
$ (": Checkbox[name= ' sysmonitoroption '][checked=true]"). each (function () {
Sysmonitorlist.push ($ (this). Val ());
});
We can break the $.each () loop at a particular iteration by making the callback function to return FALSE. Returning Non-false is the same as a continue statement into a for loop; It'll skip immediately to the next iteration.
What if we want to continue or break the loop halfway?
In each of the jquery ()
return true equals continue;
return false equals break;
But if a JS function also needs to be in each of the condition is not appropriate when return false; The idea now is to set a variable to determine whether to return false after each end.