Lesson 12. JavaScript Break and Continue |
|||||||
50 views
JavaScript break and continue StatementsThere are two special statements that can be used inside loops: break and continue. BreakThe break command will break the loop and continue executing the code that follows after the loop (if any). Example
Result
ContinueThe continue command will break the current loop and continue with the next value. Example
Result The number is 0 The number is 1 The number is 2 The number is 4 The number is 5 The number is 6 The number is 7 The number is 8 The number is 9 The number is 10 |
| « Lesson 11. JavaScript While Loop | Lesson 13. JavaScript For…In Statement » |
| Posted on Wednesday, January 28th, 2009 at 3:58 pm under Javascript For Beginners | RSS 2.0 Feed | |