0% 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.

Uploaded by

BaneeIshaqueK
Copyright
© © All Rights Reserved
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% 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.

Uploaded by

BaneeIshaqueK
Copyright
© © All Rights Reserved
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++)

if (i==!)

co%ti%$e;
#
doc$me%t&'rite("(he %$mber is " + i);
doc$me%t&'rite("<br />");
#
</script>
</body>
</html>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy