3707人加入学习
(6人评价)
Web前端第三季(JavaScript)

制作完成于2018年6月14日

价格 免费
<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>while循环</title>
    <script type="text/javascript">
        // while(true){
        //     console.log("while循环体");
        // }

        var i = 2;
        while(i<101){
            console.log(i);
            i+=2;
        }
    </script>
</head>
<body>
    
</body>
</html>

while循环
while(条件){
循环体
}

var i=0;
while(i<10){
//循环体
i++;
}

[展开全文]