|
|
Q1617 How do I exit out of a loop in JavaScript?
irt.org | Knowledge Base | JavaScript | General | Q1617 [ previous next ] Q1617 How do I exit out of a loop in JavaScript?Either by using the break or continue statement. the break statement immediately exits the loop and then continues execution from the next statement after the loop. Continue immeadiately exits the current loop and then attempts to start the loop again, depending on the loop pre-conditions. For example, the following exits the loop when the counter reaches 99:
Whereas the following only outputs odd integers between 0 and 100:
|
-- div -->
|