Articles → JAVASCRIPT → Break and continue in JavaScript

Break and continue in JavaScript


















Software requirement









Prerequisite knowledge











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