Articles → JAVASCRIPT → Break And Continue In Javascript

Break And Continue In Javascript






Software Requirement




  1. Windows any version is installed on your machine.
  2. Notepad or any text editor for writing code.

Prerequisite Knowledge




  1. Basic knowledge of JavaScript.
  2. Basic knowledge of HTML.
  3. Knowledge of any programming language is an added advantage.

What Is Break Statement?





Example Of Break Statement




<script type = "text/javascript">
    for (i = 0; i < 10; i++) {
        document.write(i);

        if (i == 5)
            break;
    }
</script>





What Is Continue Statement





Example Of Continue Statement




<script type="text/javascript">
    for (i = 0; i < 10; i++) {
        if (i == 5)
            continue;
        document.write(i);
    }
</script>





Posted By  -  Karan Gupta
 
Posted On  -  Friday, March 22, 2013

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250