Home > Article > Web Front-end > Summary of the differences between jumping out of loops in javascript and jquery_jquery
javascript:
break and continue are two special statements used in inner loops.
Use the break statement to break out of the loop;
Use the continue statement to break out of the current loop and continue with the following values.
Both return false and return true can terminate the loop and jump out of the function; the effect is the same as break.
jquery:
return false is equivalent to break to jump out of the loop
Return true is equivalent to continue jumping out of the current loop and continuing the following loop
javascript stops function execution
return can only be used inside functions