The break statement will terminate the current loop and continue executing any code after the loop. The continue statement will skip the current loop iteration and continue with the next. For example, a break could be used to terminate a loop when a condition is met, while a continue skips output for a specific loop iteration before continuing. Both allow programmatic control of loop execution flow.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
26 views2 pages
Javascript Statements: Break and Continue
The break statement will terminate the current loop and continue executing any code after the loop. The continue statement will skip the current loop iteration and continue with the next. For example, a break could be used to terminate a loop when a condition is met, while a continue skips output for a specific loop iteration before continuing. Both allow programmatic control of loop execution flow.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2
JavaScript Break and Continue Statements
The break Statement
The break statement will break the loop and continue executing the code that follows after the loop (if any) !xample <html> <body> <script type="text/javascript"> var i=0; for (i=0;i<=10;i++)
if (i==!)
brea"; # doc$me%t&'rite("(he %$mber is " + i); doc$me%t&'rite("<br />"); # </script> </body> </html> The continue Statement The continue statement will break the current loop and continue with the next value !xample <html> <body> <script type="text/javascript"> var i=0 for (i=0;i<=10;i++)