11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

{<br />

}<br />

if (x == 8)<br />

break; // breaks out of loop completely<br />

x = x + 1;<br />

document.write(x+"");<br />

<strong>The</strong> continue statement tells the interpreter to immediately start the next iteration of the loop.<br />

When it‘s encountered, program flow will move to the loop check expression immediately. <strong>The</strong><br />

example presented here shows how the continue statement is used to skip printing when the<br />

index held in variable x reaches 8:<br />

var x = 0;<br />

while (x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!