please dont rip this site

JavaScript: The Definitive Guide

Previous Chapter 5
Statements
Next
 

5.7 break

The break statement has a very simple syntax:

break;

This statement is valid only within the body of a while, for, or for/in loop. Using it outside of a loop is a syntax error. When executed, the break statement exits the currently running loop. This statement is usually used to exit a loop prematurely when, for whatever reason (perhaps when an error condition arises), there is no longer any need to complete the loop. The following example searches the elements of an array for a particular value. If the value is found, a break statement terminates the loop:

for(i =index.html 0; i < a.length; i++) {
    if (a[i] == target) 
        break;
}


Previous Home Next
for...in Book Index continue

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell

file: /Techref/language/java/script/definitive/ch05_07.htm, 3KB, , updated: 2019/10/14 15:00, local time: 2024/11/20 04:21,
TOP NEW HELP FIND: 
18.118.253.171:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.org/techref/language/java/script/definitive/ch05_07.htm"> [Chapter 5] 5.7 break</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .