JavaScript Break and Continue

1/22/2020 6:56:31 AM

JavaScript have Break and Continue keyword. This break keyword use when we won’t our condition are full then stop the execution. But continue is use when our condition is full only full fill condition are stop but other code is Continue to execution. Break is full stop when condition is match but continue is only stop which condition are match otherwise code are executing as well. Now given bellow the break and continue code and explain the code:

<!DOCTYPE html>
<script type="text/javascript">
  for(var i=0;i<=10;i++){
if (i==2||i==5) {
    //break keyword
     console.log("Show the value of i: "+i);
     if (i==6) {

In this code for loop print the value 0 to 10. Continue statement responsible to 2 and 5 value are not print but break statement responsible to stop the code when I value is 6 also this code is stop now so 7 to 10 are not print.