continue and break

        <script type="text/javascript">
        var i=1;
        computer:
        while(true){
            i++;
            switch(i){
                case 5:
                    console.log(i);
                    break 
                case 10 :
                    console.log(i);
                    break;
                case 15:
                    console.log(i);
                    break computer;
            }
        }
        </script>

break : used in loops and switches

       Jump out of the current loop

continue : used inside a loop

   Jump out of this cycle and enter the next cycle

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324781572&siteId=291194637