zoukankan      html  css  js  c++  java
  • 2.break与continue

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title> 演示示例:break与continue </title>
      <meta http-equiv = "content-type" content ="text/html;charset=utf-8" /> 
      <meta name="keywords" content="">
      <meta name="description" content=""> 
     </head>  
     <body>
      <script type="text/javascript">
        // break 中断循环 
        document.write("<br/>---------------break 中断循环------------<br/>");
        var i=0;
        for (i=0;i<=10;i++)
        {
            if (i==3){break;}
            document.write("The number is " + i);
            document.write("<br />");
        }
        
      </script>
    
       <script type="text/javascript">
        // continue 跳过并继续接下来的循环
        document.write("<br/>---------------continue 中断循环------------<br/>");
        var i=0;
        for (i=0;i<=10;i++)
        {
            if (i==3){continue;}
            document.write("The number is " + i);
            document.write("<br />");
        }
        
      </script>
     </body>
    </html>
  • 相关阅读:
    [概率论]2017.5.9
    [概率论] 2017 5.2
    [离散数学II]2017.5.2
    [离散数学II]2017.4.25
    [概率论]2017.4.19
    [概率论] 2017.4.18
    [离散数学II]2017.4.18
    [离散数学II]2017.4.11
    [概率论]2017.4.12
    [概率论]2017.4.5
  • 原文地址:https://www.cnblogs.com/xiaotaoxu/p/5539199.html
Copyright © 2011-2022 走看看