Home > Web Front-end > JS Tutorial > Tutorial on the difference between JavaScript Break and Continue_Basic knowledge

Tutorial on the difference between JavaScript Break and Continue_Basic knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 19:15:39
Original
1186 people have browsed it

There are two statements that can be used in loops: break and continue.
JavaScript break and continue declarations
There are two special declarations that can be used inside loops: break and continue.

Break
The break command can terminate the execution of the loop and then continue executing the code after the loop (if there is code after the loop).
Example:


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]

Result:
The number is 0
The number is 1
The number is 2Continue
The continue command will terminate the current loop and continue from the next value.

Example:

[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]

Result:
The number is 0
The number is 1
The number is 2
The number is 4
The number is 5
The number is 6
The number is 7
The number is 8 The number is 9 The number is 10
Related labels:
Statement of this Website
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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template