美文网首页
2018-07-25 while循环

2018-07-25 while循环

作者: 菜鸟亿个 | 来源:发表于2018-07-25 15:43 被阅读0次

!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script>

    var count = 5;  //初始值

    console.log("开始循环");

    while (count >= 1) {
        console.log("count :" + count);
        document.write("count :" + count + "<br/>")
        count--;  // count = count -1; count:  4 , 3 2 1 0 改变循环条件语句
    }

    console.log("结束循环");

</script>

</head>
<body>

</body>
</html>

相关文章

网友评论

      本文标题:2018-07-25 while循环

      本文链接:https://www.haomeiwen.com/subject/pqnpmftx.html