Home  >  Article  >  Web Front-end  >  Summary of the differences between jumping out of loops in javascript and jquery_jquery

Summary of the differences between jumping out of loops in javascript and jquery_jquery

WBOY
WBOYOriginal
2016-05-16 17:17:43777browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn