# JavaScript Break and Continue
● The Break Statement
The break statement can be used to jump out of a loop.
The break statement breaks the loop and continues executing the code after the loop.
The break statement breaks the loop and continues executing the code after the loop.
● The Continue Statement
The continue statement breaks one iteration ( in the loop ), if a specified condition occurs, and continues with the next iteration in the loop.
● JavaScript Labels
To label JavaScript statements Programmer precede the statements with a label name and a colon.
The break and the continue statements are the only JSP statements that can "jump out of" a code block.
The continue statement ( with or without a label reference) can only be used to skip one loop iteration.
The break statement, without a label reference, can only be used to jump out of a loop or switch.
With a label reference, the break statement can be used to jump out of any code block.
The break and the continue statements are the only JSP statements that can "jump out of" a code block.
The continue statement ( with or without a label reference) can only be used to skip one loop iteration.
The break statement, without a label reference, can only be used to jump out of a loop or switch.
With a label reference, the break statement can be used to jump out of any code block.
No comments:
Post a Comment